@amenophis1er/foreman 0.1.15 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -3
- package/package.json +1 -1
- package/src/fleet-planner.test.ts +39 -1
- package/src/fleet-planner.ts +83 -3
- package/src/gitwork.test.ts +89 -2
- package/src/gitwork.ts +134 -0
- package/src/mcp.test.ts +38 -1
- package/src/mcp.ts +75 -3
- package/src/notify/commands.test.ts +2 -0
- package/src/notify/commands.ts +6 -0
- package/src/notify/telegram.ts +1 -0
- package/src/notify.test.ts +61 -0
- package/src/notify.ts +45 -1
- package/src/orchestrator.ts +20 -9
- package/src/schedule-guards.test.ts +236 -0
- package/src/schedule-guards.ts +149 -0
- package/src/schedule.test.ts +240 -0
- package/src/schedule.ts +343 -0
- package/src/server.ts +624 -17
- package/src/services.test.ts +46 -1
- package/src/services.ts +62 -3
- package/src/store.test.ts +81 -1
- package/src/store.ts +117 -3
- package/src/types.ts +64 -1
- package/ui/dist/assets/index-Bcc4KMtO.js +68 -0
- package/ui/dist/index.html +1 -1
- package/ui/dist/assets/index-CnCv2QiH.js +0 -68
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const h of d)if(h.type==="childList")for(const m of h.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&o(m)}).observe(document,{childList:!0,subtree:!0});function u(d){const h={};return d.integrity&&(h.integrity=d.integrity),d.referrerPolicy&&(h.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?h.credentials="include":d.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function o(d){if(d.ep)return;d.ep=!0;const h=u(d);fetch(d.href,h)}})();function jg(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Mc={exports:{}},Ri={};var Kh;function Sg(){if(Kh)return Ri;Kh=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function u(o,d,h){var m=null;if(h!==void 0&&(m=""+h),d.key!==void 0&&(m=""+d.key),"key"in d){h={};for(var y in d)y!=="key"&&(h[y]=d[y])}else h=d;return d=h.ref,{$$typeof:i,type:o,key:m,ref:d!==void 0?d:null,props:h}}return Ri.Fragment=c,Ri.jsx=u,Ri.jsxs=u,Ri}var Zh;function kg(){return Zh||(Zh=1,Mc.exports=Sg()),Mc.exports}var l=kg(),Ec={exports:{}},be={};var Fh;function wg(){if(Fh)return be;Fh=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),m=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),k=Symbol.iterator;function w(T){return T===null||typeof T!="object"?null:(T=k&&T[k]||T["@@iterator"],typeof T=="function"?T:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},X=Object.assign,M={};function z(T,Q,A){this.props=T,this.context=Q,this.refs=M,this.updater=A||_}z.prototype.isReactComponent={},z.prototype.setState=function(T,Q){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,Q,"setState")},z.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function R(){}R.prototype=z.prototype;function N(T,Q,A){this.props=T,this.context=Q,this.refs=M,this.updater=A||_}var Z=N.prototype=new R;Z.constructor=N,X(Z,z.prototype),Z.isPureReactComponent=!0;var re=Array.isArray;function B(){}var L={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function G(T,Q,A){var F=A.ref;return{$$typeof:i,type:T,key:Q,ref:F!==void 0?F:null,props:A}}function ce(T,Q){return G(T.type,Q,T.props)}function te(T){return typeof T=="object"&&T!==null&&T.$$typeof===i}function ee(T){var Q={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(A){return Q[A]})}var xe=/\/+/g;function se(T,Q){return typeof T=="object"&&T!==null&&T.key!=null?ee(""+T.key):Q.toString(36)}function me(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(B,B):(T.status="pending",T.then(function(Q){T.status==="pending"&&(T.status="fulfilled",T.value=Q)},function(Q){T.status==="pending"&&(T.status="rejected",T.reason=Q)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function j(T,Q,A,F,ne){var oe=typeof T;(oe==="undefined"||oe==="boolean")&&(T=null);var je=!1;if(T===null)je=!0;else switch(oe){case"bigint":case"string":case"number":je=!0;break;case"object":switch(T.$$typeof){case i:case c:je=!0;break;case S:return je=T._init,j(je(T._payload),Q,A,F,ne)}}if(je)return ne=ne(T),je=F===""?"."+se(T,0):F,re(ne)?(A="",je!=null&&(A=je.replace(xe,"$&/")+"/"),j(ne,Q,A,"",function(W){return W})):ne!=null&&(te(ne)&&(ne=ce(ne,A+(ne.key==null||T&&T.key===ne.key?"":(""+ne.key).replace(xe,"$&/")+"/")+je)),Q.push(ne)),1;je=0;var Ue=F===""?".":F+":";if(re(T))for(var ge=0;ge<T.length;ge++)F=T[ge],oe=Ue+se(F,ge),je+=j(F,Q,A,oe,ne);else if(ge=w(T),typeof ge=="function")for(T=ge.call(T),ge=0;!(F=T.next()).done;)F=F.value,oe=Ue+se(F,ge++),je+=j(F,Q,A,oe,ne);else if(oe==="object"){if(typeof T.then=="function")return j(me(T),Q,A,F,ne);throw Q=String(T),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return je}function q(T,Q,A){if(T==null)return T;var F=[],ne=0;return j(T,F,"","",function(oe){return Q.call(A,oe,ne++)}),F}function O(T){if(T._status===-1){var Q=T._result;Q=Q(),Q.then(function(A){(T._status===0||T._status===-1)&&(T._status=1,T._result=A)},function(A){(T._status===0||T._status===-1)&&(T._status=2,T._result=A)}),T._status===-1&&(T._status=0,T._result=Q)}if(T._status===1)return T._result.default;throw T._result}var ue=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=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(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},he={map:q,forEach:function(T,Q,A){q(T,function(){Q.apply(this,arguments)},A)},count:function(T){var Q=0;return q(T,function(){Q++}),Q},toArray:function(T){return q(T,function(Q){return Q})||[]},only:function(T){if(!te(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return be.Activity=b,be.Children=he,be.Component=z,be.Fragment=u,be.Profiler=d,be.PureComponent=N,be.StrictMode=o,be.Suspense=x,be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,be.__COMPILER_RUNTIME={__proto__:null,c:function(T){return L.H.useMemoCache(T)}},be.cache=function(T){return function(){return T.apply(null,arguments)}},be.cacheSignal=function(){return null},be.cloneElement=function(T,Q,A){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var F=X({},T.props),ne=T.key;if(Q!=null)for(oe in Q.key!==void 0&&(ne=""+Q.key),Q)!P.call(Q,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&Q.ref===void 0||(F[oe]=Q[oe]);var oe=arguments.length-2;if(oe===1)F.children=A;else if(1<oe){for(var je=Array(oe),Ue=0;Ue<oe;Ue++)je[Ue]=arguments[Ue+2];F.children=je}return G(T.type,ne,F)},be.createContext=function(T){return T={$$typeof:m,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:h,_context:T},T},be.createElement=function(T,Q,A){var F,ne={},oe=null;if(Q!=null)for(F in Q.key!==void 0&&(oe=""+Q.key),Q)P.call(Q,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(ne[F]=Q[F]);var je=arguments.length-2;if(je===1)ne.children=A;else if(1<je){for(var Ue=Array(je),ge=0;ge<je;ge++)Ue[ge]=arguments[ge+2];ne.children=Ue}if(T&&T.defaultProps)for(F in je=T.defaultProps,je)ne[F]===void 0&&(ne[F]=je[F]);return G(T,oe,ne)},be.createRef=function(){return{current:null}},be.forwardRef=function(T){return{$$typeof:y,render:T}},be.isValidElement=te,be.lazy=function(T){return{$$typeof:S,_payload:{_status:-1,_result:T},_init:O}},be.memo=function(T,Q){return{$$typeof:p,type:T,compare:Q===void 0?null:Q}},be.startTransition=function(T){var Q=L.T,A={};L.T=A;try{var F=T(),ne=L.S;ne!==null&&ne(A,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(B,ue)}catch(oe){ue(oe)}finally{Q!==null&&A.types!==null&&(Q.types=A.types),L.T=Q}},be.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},be.use=function(T){return L.H.use(T)},be.useActionState=function(T,Q,A){return L.H.useActionState(T,Q,A)},be.useCallback=function(T,Q){return L.H.useCallback(T,Q)},be.useContext=function(T){return L.H.useContext(T)},be.useDebugValue=function(){},be.useDeferredValue=function(T,Q){return L.H.useDeferredValue(T,Q)},be.useEffect=function(T,Q){return L.H.useEffect(T,Q)},be.useEffectEvent=function(T){return L.H.useEffectEvent(T)},be.useId=function(){return L.H.useId()},be.useImperativeHandle=function(T,Q,A){return L.H.useImperativeHandle(T,Q,A)},be.useInsertionEffect=function(T,Q){return L.H.useInsertionEffect(T,Q)},be.useLayoutEffect=function(T,Q){return L.H.useLayoutEffect(T,Q)},be.useMemo=function(T,Q){return L.H.useMemo(T,Q)},be.useOptimistic=function(T,Q){return L.H.useOptimistic(T,Q)},be.useReducer=function(T,Q,A){return L.H.useReducer(T,Q,A)},be.useRef=function(T){return L.H.useRef(T)},be.useState=function(T){return L.H.useState(T)},be.useSyncExternalStore=function(T,Q,A){return L.H.useSyncExternalStore(T,Q,A)},be.useTransition=function(){return L.H.useTransition()},be.version="19.2.8",be}var Jh;function nu(){return Jh||(Jh=1,Ec.exports=wg()),Ec.exports}var g=nu();const vn=jg(g);var _c={exports:{}},Oi={},Dc={exports:{}},Ac={};var Ih;function zg(){return Ih||(Ih=1,(function(i){function c(j,q){var O=j.length;j.push(q);e:for(;0<O;){var ue=O-1>>>1,he=j[ue];if(0<d(he,q))j[ue]=q,j[O]=he,O=ue;else break e}}function u(j){return j.length===0?null:j[0]}function o(j){if(j.length===0)return null;var q=j[0],O=j.pop();if(O!==q){j[0]=O;e:for(var ue=0,he=j.length,T=he>>>1;ue<T;){var Q=2*(ue+1)-1,A=j[Q],F=Q+1,ne=j[F];if(0>d(A,O))F<he&&0>d(ne,A)?(j[ue]=ne,j[F]=O,ue=F):(j[ue]=A,j[Q]=O,ue=Q);else if(F<he&&0>d(ne,O))j[ue]=ne,j[F]=O,ue=F;else break e}}return q}function d(j,q){var O=j.sortIndex-q.sortIndex;return O!==0?O:j.id-q.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;i.unstable_now=function(){return h.now()}}else{var m=Date,y=m.now();i.unstable_now=function(){return m.now()-y}}var x=[],p=[],S=1,b=null,k=3,w=!1,_=!1,X=!1,M=!1,z=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function Z(j){for(var q=u(p);q!==null;){if(q.callback===null)o(p);else if(q.startTime<=j)o(p),q.sortIndex=q.expirationTime,c(x,q);else break;q=u(p)}}function re(j){if(X=!1,Z(j),!_)if(u(x)!==null)_=!0,B||(B=!0,ee());else{var q=u(p);q!==null&&me(re,q.startTime-j)}}var B=!1,L=-1,P=5,G=-1;function ce(){return M?!0:!(i.unstable_now()-G<P)}function te(){if(M=!1,B){var j=i.unstable_now();G=j;var q=!0;try{e:{_=!1,X&&(X=!1,R(L),L=-1),w=!0;var O=k;try{t:{for(Z(j),b=u(x);b!==null&&!(b.expirationTime>j&&ce());){var ue=b.callback;if(typeof ue=="function"){b.callback=null,k=b.priorityLevel;var he=ue(b.expirationTime<=j);if(j=i.unstable_now(),typeof he=="function"){b.callback=he,Z(j),q=!0;break t}b===u(x)&&o(x),Z(j)}else o(x);b=u(x)}if(b!==null)q=!0;else{var T=u(p);T!==null&&me(re,T.startTime-j),q=!1}}break e}finally{b=null,k=O,w=!1}q=void 0}}finally{q?ee():B=!1}}}var ee;if(typeof N=="function")ee=function(){N(te)};else if(typeof MessageChannel<"u"){var xe=new MessageChannel,se=xe.port2;xe.port1.onmessage=te,ee=function(){se.postMessage(null)}}else ee=function(){z(te,0)};function me(j,q){L=z(function(){j(i.unstable_now())},q)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(j){j.callback=null},i.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<j?Math.floor(1e3/j):5},i.unstable_getCurrentPriorityLevel=function(){return k},i.unstable_next=function(j){switch(k){case 1:case 2:case 3:var q=3;break;default:q=k}var O=k;k=q;try{return j()}finally{k=O}},i.unstable_requestPaint=function(){M=!0},i.unstable_runWithPriority=function(j,q){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var O=k;k=j;try{return q()}finally{k=O}},i.unstable_scheduleCallback=function(j,q,O){var ue=i.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?ue+O:ue):O=ue,j){case 1:var he=-1;break;case 2:he=250;break;case 5:he=1073741823;break;case 4:he=1e4;break;default:he=5e3}return he=O+he,j={id:S++,callback:q,priorityLevel:j,startTime:O,expirationTime:he,sortIndex:-1},O>ue?(j.sortIndex=O,c(p,j),u(x)===null&&j===u(p)&&(X?(R(L),L=-1):X=!0,me(re,O-ue))):(j.sortIndex=he,c(x,j),_||w||(_=!0,B||(B=!0,ee()))),j},i.unstable_shouldYield=ce,i.unstable_wrapCallback=function(j){var q=k;return function(){var O=k;k=q;try{return j.apply(this,arguments)}finally{k=O}}}})(Ac)),Ac}var Ph;function Cg(){return Ph||(Ph=1,Dc.exports=zg()),Dc.exports}var Rc={exports:{}},yt={};var ep;function Tg(){if(ep)return yt;ep=1;var i=nu();function c(x){var p="https://react.dev/errors/"+x;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)p+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+x+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var o={d:{f:u,r:function(){throw Error(c(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},d=Symbol.for("react.portal");function h(x,p,S){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:b==null?null:""+b,children:x,containerInfo:p,implementation:S}}var m=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function y(x,p){if(x==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return yt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,yt.createPortal=function(x,p){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(c(299));return h(x,p,null,S)},yt.flushSync=function(x){var p=m.T,S=o.p;try{if(m.T=null,o.p=2,x)return x()}finally{m.T=p,o.p=S,o.d.f()}},yt.preconnect=function(x,p){typeof x=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,o.d.C(x,p))},yt.prefetchDNS=function(x){typeof x=="string"&&o.d.D(x)},yt.preinit=function(x,p){if(typeof x=="string"&&p&&typeof p.as=="string"){var S=p.as,b=y(S,p.crossOrigin),k=typeof p.integrity=="string"?p.integrity:void 0,w=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;S==="style"?o.d.S(x,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:b,integrity:k,fetchPriority:w}):S==="script"&&o.d.X(x,{crossOrigin:b,integrity:k,fetchPriority:w,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},yt.preinitModule=function(x,p){if(typeof x=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var S=y(p.as,p.crossOrigin);o.d.M(x,{crossOrigin:S,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&o.d.M(x)},yt.preload=function(x,p){if(typeof x=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var S=p.as,b=y(S,p.crossOrigin);o.d.L(x,S,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},yt.preloadModule=function(x,p){if(typeof x=="string")if(p){var S=y(p.as,p.crossOrigin);o.d.m(x,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:S,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else o.d.m(x)},yt.requestFormReset=function(x){o.d.r(x)},yt.unstable_batchedUpdates=function(x,p){return x(p)},yt.useFormState=function(x,p,S){return m.H.useFormState(x,p,S)},yt.useFormStatus=function(){return m.H.useHostTransitionStatus()},yt.version="19.2.8",yt}var tp;function Mg(){if(tp)return Rc.exports;tp=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),Rc.exports=Tg(),Rc.exports}var np;function Eg(){if(np)return Oi;np=1;var i=Cg(),c=nu(),u=Mg();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function x(e){if(h(e)!==e)throw Error(o(188))}function p(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(o(188));return t!==e?null:e}for(var n=e,a=t;;){var s=n.return;if(s===null)break;var r=s.alternate;if(r===null){if(a=s.return,a!==null){n=a;continue}break}if(s.child===r.child){for(r=s.child;r;){if(r===n)return x(s),e;if(r===a)return x(s),t;r=r.sibling}throw Error(o(188))}if(n.return!==a.return)n=s,a=r;else{for(var f=!1,v=s.child;v;){if(v===n){f=!0,n=s,a=r;break}if(v===a){f=!0,a=s,n=r;break}v=v.sibling}if(!f){for(v=r.child;v;){if(v===n){f=!0,n=r,a=s;break}if(v===a){f=!0,a=r,n=s;break}v=v.sibling}if(!f)throw Error(o(189))}}if(n.alternate!==a)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function S(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=S(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,k=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),X=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),N=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),re=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),ce=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function ee(e){return e===null||typeof e!="object"?null:(e=te&&e[te]||e["@@iterator"],typeof e=="function"?e:null)}var xe=Symbol.for("react.client.reference");function se(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===xe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case X:return"Fragment";case z:return"Profiler";case M:return"StrictMode";case re:return"Suspense";case B:return"SuspenseList";case G:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case _:return"Portal";case N:return e.displayName||"Context";case R:return(e._context.displayName||"Context")+".Consumer";case Z:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case L:return t=e.displayName||null,t!==null?t:se(e.type)||"Memo";case P:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}var me=Array.isArray,j=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O={pending:!1,data:null,method:null,action:null},ue=[],he=-1;function T(e){return{current:e}}function Q(e){0>he||(e.current=ue[he],ue[he]=null,he--)}function A(e,t){he++,ue[he]=e.current,e.current=t}var F=T(null),ne=T(null),oe=T(null),je=T(null);function Ue(e,t){switch(A(oe,t),A(ne,e),A(F,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=gh(t),e=yh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Q(F),A(F,e)}function ge(){Q(F),Q(ne),Q(oe)}function W(e){e.memoizedState!==null&&A(je,e);var t=F.current,n=yh(t,e.type);t!==n&&(A(ne,e),A(F,n))}function ze(e){ne.current===e&&(Q(F),Q(ne)),je.current===e&&(Q(je),Ei._currentValue=O)}var ae,Ke;function Ae(e){if(ae===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ae=t&&t[1]||"",Ke=-1<n.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+ae+e+Ke}var wt=!1;function zt(e,t){if(!e||wt)return"";wt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var J=function(){throw Error()};if(Object.defineProperty(J.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(J,[])}catch(Y){var $=Y}Reflect.construct(e,[],J)}else{try{J.call()}catch(Y){$=Y}e.call(J.prototype)}}else{try{throw Error()}catch(Y){$=Y}(J=e())&&typeof J.catch=="function"&&J.catch(function(){})}}catch(Y){if(Y&&$&&typeof Y.stack=="string")return[Y.stack,$.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=a.DetermineComponentFrameRoot(),f=r[0],v=r[1];if(f&&v){var C=f.split(`
|
|
4
|
+
`),H=v.split(`
|
|
5
|
+
`);for(s=a=0;a<C.length&&!C[a].includes("DetermineComponentFrameRoot");)a++;for(;s<H.length&&!H[s].includes("DetermineComponentFrameRoot");)s++;if(a===C.length||s===H.length)for(a=C.length-1,s=H.length-1;1<=a&&0<=s&&C[a]!==H[s];)s--;for(;1<=a&&0<=s;a--,s--)if(C[a]!==H[s]){if(a!==1||s!==1)do if(a--,s--,0>s||C[a]!==H[s]){var V=`
|
|
6
|
+
`+C[a].replace(" at new "," at ");return e.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",e.displayName)),V}while(1<=a&&0<=s);break}}}finally{wt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ae(n):""}function Hl(e,t){switch(e.tag){case 26:case 27:case 5:return Ae(e.type);case 16:return Ae("Lazy");case 13:return e.child!==t&&t!==null?Ae("Suspense Fallback"):Ae("Suspense");case 19:return Ae("SuspenseList");case 0:case 15:return zt(e.type,!1);case 11:return zt(e.type.render,!1);case 1:return zt(e.type,!0);case 31:return Ae("Activity");default:return""}}function rn(e){try{var t="",n=null;do t+=Hl(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
|
|
7
|
+
Error generating stack: `+a.message+`
|
|
8
|
+
`+a.stack}}var Wn=Object.prototype.hasOwnProperty,Bl=i.unstable_scheduleCallback,Wa=i.unstable_cancelCallback,yr=i.unstable_shouldYield,qi=i.unstable_requestPaint,bt=i.unstable_now,Xa=i.unstable_getCurrentPriorityLevel,$l=i.unstable_ImmediatePriority,ql=i.unstable_UserBlockingPriority,Va=i.unstable_NormalPriority,Li=i.unstable_LowPriority,xa=i.unstable_IdlePriority,Ll=i.log,Yi=i.unstable_setDisableYieldValue,ba=null,mt=null;function en(e){if(typeof Ll=="function"&&Yi(e),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(ba,e)}catch{}}var jt=Math.clz32?Math.clz32:Gi,gn=Math.log,Qa=Math.LN2;function Gi(e){return e>>>=0,e===0?32:31-(gn(e)/Qa|0)|0}var ja=256,Sa=262144,yn=4194304;function qt(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ka(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var s=0,r=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var v=a&134217727;return v!==0?(a=v&~r,a!==0?s=qt(a):(f&=v,f!==0?s=qt(f):n||(n=v&~e,n!==0&&(s=qt(n))))):(v=a&~r,v!==0?s=qt(v):f!==0?s=qt(f):n||(n=a&~e,n!==0&&(s=qt(n)))),s===0?0:t!==0&&t!==s&&(t&r)===0&&(r=s&-s,n=t&-t,r>=n||r===32&&(n&4194048)!==0)?t:s}function Xn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Yl(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Wi(){var e=yn;return yn<<=1,(yn&62914560)===0&&(yn=4194304),e}function Ka(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function xn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function bn(e,t,n,a,s,r){var f=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var v=e.entanglements,C=e.expirationTimes,H=e.hiddenUpdates;for(n=f&~n;0<n;){var V=31-jt(n),J=1<<V;v[V]=0,C[V]=-1;var $=H[V];if($!==null)for(H[V]=null,V=0;V<$.length;V++){var Y=$[V];Y!==null&&(Y.lane&=-536870913)}n&=~J}a!==0&&on(e,a,0),r!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=r&~(f&~t))}function on(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-jt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function jn(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-jt(n),s=1<<a;s&t|e[a]&t&&(e[a]|=t),n&=~s}}function Za(e,t){var n=t&-t;return n=(n&42)!==0?1:wa(n),(n&(e.suspendedLanes|t))!==0?0:n}function wa(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Fa(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Xi(){var e=q.p;return e!==0?e:(e=window.event,e===void 0?32:Lh(e.type))}function Vi(e,t){var n=q.p;try{return q.p=e,t()}finally{q.p=n}}var Lt=Math.random().toString(36).slice(2),Je="__reactFiber$"+Lt,gt="__reactProps$"+Lt,cn="__reactContainer$"+Lt,Gl="__reactEvents$"+Lt,Ja="__reactListeners$"+Lt,xr="__reactHandles$"+Lt,Qi="__reactResources$"+Lt,Sn="__reactMarker$"+Lt;function Ia(e){delete e[Je],delete e[gt],delete e[Gl],delete e[Ja],delete e[xr]}function kn(e){var t=e[Je];if(t)return t;for(var n=e.parentNode;n;){if(t=n[cn]||n[Je]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=zh(e);e!==null;){if(n=e[Je])return n;e=zh(e)}return t}e=n,n=e.parentNode}return null}function wn(e){if(e=e[Je]||e[cn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Vn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function zn(e){var t=e[Qi];return t||(t=e[Qi]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function at(e){e[Sn]=!0}var Ki=new Set,Wl={};function I(e,t){Ce(e,t),Ce(e+"Capture",t)}function Ce(e,t){for(Wl[e]=t,e=0;e<t.length;e++)Ki.add(t[e])}var St=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]*$"),Qn={},tn={};function Xl(e){return Wn.call(tn,e)?!0:Wn.call(Qn,e)?!1:St.test(e)?tn[e]=!0:(Qn[e]=!0,!1)}function Zi(e,t,n){if(Xl(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Fi(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Cn(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+a)}}function Yt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ou(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function pv(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var s=a.get,r=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(f){n=""+f,r.call(this,f)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(f){n=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function br(e){if(!e._valueTracker){var t=ou(e)?"checked":"value";e._valueTracker=pv(e,t,""+e[t])}}function cu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=ou(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function Ji(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var vv=/[\n"\\]/g;function Gt(e){return e.replace(vv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function jr(e,t,n,a,s,r,f,v){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Yt(t)):e.value!==""+Yt(t)&&(e.value=""+Yt(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?Sr(e,f,Yt(t)):n!=null?Sr(e,f,Yt(n)):a!=null&&e.removeAttribute("value"),s==null&&r!=null&&(e.defaultChecked=!!r),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+Yt(v):e.removeAttribute("name")}function uu(e,t,n,a,s,r,f,v){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||n!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){br(e);return}n=n!=null?""+Yt(n):"",t=t!=null?""+Yt(t):n,v||t===e.value||(e.value=t),e.defaultValue=t}a=a??s,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=v?e.checked:!!a,e.defaultChecked=!!a,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),br(e)}function Sr(e,t,n){t==="number"&&Ji(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Pa(e,t,n,a){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&a&&(e[n].defaultSelected=!0)}else{for(n=""+Yt(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,a&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function du(e,t,n){if(t!=null&&(t=""+Yt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Yt(n):""}function fu(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(o(92));if(me(a)){if(1<a.length)throw Error(o(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=Yt(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),br(e)}function el(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var mv=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 hu(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||mv.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function pu(e,t,n){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var s in t)a=t[s],t.hasOwnProperty(s)&&n[s]!==a&&hu(e,s,a)}else for(var r in t)t.hasOwnProperty(r)&&hu(e,r,t[r])}function kr(e){if(e.indexOf("-")===-1)return!1;switch(e){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 gv=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"]]),yv=/^[\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 Ii(e){return yv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Tn(){}var wr=null;function zr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tl=null,nl=null;function vu(e){var t=wn(e);if(t&&(e=t.stateNode)){var n=e[gt]||null;e:switch(e=t.stateNode,t.type){case"input":if(jr(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Gt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var s=a[gt]||null;if(!s)throw Error(o(90));jr(a,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&cu(a)}break e;case"textarea":du(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Pa(e,!!n.multiple,t,!1)}}}var Cr=!1;function mu(e,t,n){if(Cr)return e(t,n);Cr=!0;try{var a=e(t);return a}finally{if(Cr=!1,(tl!==null||nl!==null)&&($s(),tl&&(t=tl,e=nl,nl=tl=null,vu(t),e)))for(t=0;t<e.length;t++)vu(e[t])}}function Vl(e,t){var n=e.stateNode;if(n===null)return null;var a=n[gt]||null;if(a===null)return null;n=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(o(231,t,typeof n));return n}var Mn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Tr=!1;if(Mn)try{var Ql={};Object.defineProperty(Ql,"passive",{get:function(){Tr=!0}}),window.addEventListener("test",Ql,Ql),window.removeEventListener("test",Ql,Ql)}catch{Tr=!1}var Kn=null,Mr=null,Pi=null;function gu(){if(Pi)return Pi;var e,t=Mr,n=t.length,a,s="value"in Kn?Kn.value:Kn.textContent,r=s.length;for(e=0;e<n&&t[e]===s[e];e++);var f=n-e;for(a=1;a<=f&&t[n-a]===s[r-a];a++);return Pi=s.slice(e,1<a?1-a:void 0)}function es(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ts(){return!0}function yu(){return!1}function Ct(e){function t(n,a,s,r,f){this._reactName=n,this._targetInst=s,this.type=a,this.nativeEvent=r,this.target=f,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(n=e[v],this[v]=n?n(r):r[v]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?ts:yu,this.isPropagationStopped=yu,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ts)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ts)},persist:function(){},isPersistent:ts}),t}var za={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ns=Ct(za),Kl=b({},za,{view:0,detail:0}),xv=Ct(Kl),Er,_r,Zl,as=b({},Kl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ar,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Zl&&(Zl&&e.type==="mousemove"?(Er=e.screenX-Zl.screenX,_r=e.screenY-Zl.screenY):_r=Er=0,Zl=e),Er)},movementY:function(e){return"movementY"in e?e.movementY:_r}}),xu=Ct(as),bv=b({},as,{dataTransfer:0}),jv=Ct(bv),Sv=b({},Kl,{relatedTarget:0}),Dr=Ct(Sv),kv=b({},za,{animationName:0,elapsedTime:0,pseudoElement:0}),wv=Ct(kv),zv=b({},za,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Cv=Ct(zv),Tv=b({},za,{data:0}),bu=Ct(Tv),Mv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ev={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"},_v={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Dv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=_v[e])?!!t[e]:!1}function Ar(){return Dv}var Av=b({},Kl,{key:function(e){if(e.key){var t=Mv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=es(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ev[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ar,charCode:function(e){return e.type==="keypress"?es(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?es(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Rv=Ct(Av),Ov=b({},as,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ju=Ct(Ov),Nv=b({},Kl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ar}),Uv=Ct(Nv),Hv=b({},za,{propertyName:0,elapsedTime:0,pseudoElement:0}),Bv=Ct(Hv),$v=b({},as,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),qv=Ct($v),Lv=b({},za,{newState:0,oldState:0}),Yv=Ct(Lv),Gv=[9,13,27,32],Rr=Mn&&"CompositionEvent"in window,Fl=null;Mn&&"documentMode"in document&&(Fl=document.documentMode);var Wv=Mn&&"TextEvent"in window&&!Fl,Su=Mn&&(!Rr||Fl&&8<Fl&&11>=Fl),ku=" ",wu=!1;function zu(e,t){switch(e){case"keyup":return Gv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var al=!1;function Xv(e,t){switch(e){case"compositionend":return Cu(t);case"keypress":return t.which!==32?null:(wu=!0,ku);case"textInput":return e=t.data,e===ku&&wu?null:e;default:return null}}function Vv(e,t){if(al)return e==="compositionend"||!Rr&&zu(e,t)?(e=gu(),Pi=Mr=Kn=null,al=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Su&&t.locale!=="ko"?null:t.data;default:return null}}var Qv={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 Tu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Qv[e.type]:t==="textarea"}function Mu(e,t,n,a){tl?nl?nl.push(a):nl=[a]:tl=a,t=Vs(t,"onChange"),0<t.length&&(n=new ns("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var Jl=null,Il=null;function Kv(e){dh(e,0)}function ls(e){var t=Vn(e);if(cu(t))return e}function Eu(e,t){if(e==="change")return t}var _u=!1;if(Mn){var Or;if(Mn){var Nr="oninput"in document;if(!Nr){var Du=document.createElement("div");Du.setAttribute("oninput","return;"),Nr=typeof Du.oninput=="function"}Or=Nr}else Or=!1;_u=Or&&(!document.documentMode||9<document.documentMode)}function Au(){Jl&&(Jl.detachEvent("onpropertychange",Ru),Il=Jl=null)}function Ru(e){if(e.propertyName==="value"&&ls(Il)){var t=[];Mu(t,Il,e,zr(e)),mu(Kv,t)}}function Zv(e,t,n){e==="focusin"?(Au(),Jl=t,Il=n,Jl.attachEvent("onpropertychange",Ru)):e==="focusout"&&Au()}function Fv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ls(Il)}function Jv(e,t){if(e==="click")return ls(t)}function Iv(e,t){if(e==="input"||e==="change")return ls(t)}function Pv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var At=typeof Object.is=="function"?Object.is:Pv;function Pl(e,t){if(At(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var s=n[a];if(!Wn.call(t,s)||!At(e[s],t[s]))return!1}return!0}function Ou(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Nu(e,t){var n=Ou(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ou(n)}}function Uu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Uu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ji(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ji(e.document)}return t}function Ur(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var em=Mn&&"documentMode"in document&&11>=document.documentMode,ll=null,Hr=null,ei=null,Br=!1;function Bu(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Br||ll==null||ll!==Ji(a)||(a=ll,"selectionStart"in a&&Ur(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),ei&&Pl(ei,a)||(ei=a,a=Vs(Hr,"onSelect"),0<a.length&&(t=new ns("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=ll)))}function Ca(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var il={animationend:Ca("Animation","AnimationEnd"),animationiteration:Ca("Animation","AnimationIteration"),animationstart:Ca("Animation","AnimationStart"),transitionrun:Ca("Transition","TransitionRun"),transitionstart:Ca("Transition","TransitionStart"),transitioncancel:Ca("Transition","TransitionCancel"),transitionend:Ca("Transition","TransitionEnd")},$r={},$u={};Mn&&($u=document.createElement("div").style,"AnimationEvent"in window||(delete il.animationend.animation,delete il.animationiteration.animation,delete il.animationstart.animation),"TransitionEvent"in window||delete il.transitionend.transition);function Ta(e){if($r[e])return $r[e];if(!il[e])return e;var t=il[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in $u)return $r[e]=t[n];return e}var qu=Ta("animationend"),Lu=Ta("animationiteration"),Yu=Ta("animationstart"),tm=Ta("transitionrun"),nm=Ta("transitionstart"),am=Ta("transitioncancel"),Gu=Ta("transitionend"),Wu=new Map,qr="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(" ");qr.push("scrollEnd");function nn(e,t){Wu.set(e,t),I(t,[e])}var is=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Wt=[],sl=0,Lr=0;function ss(){for(var e=sl,t=Lr=sl=0;t<e;){var n=Wt[t];Wt[t++]=null;var a=Wt[t];Wt[t++]=null;var s=Wt[t];Wt[t++]=null;var r=Wt[t];if(Wt[t++]=null,a!==null&&s!==null){var f=a.pending;f===null?s.next=s:(s.next=f.next,f.next=s),a.pending=s}r!==0&&Xu(n,s,r)}}function rs(e,t,n,a){Wt[sl++]=e,Wt[sl++]=t,Wt[sl++]=n,Wt[sl++]=a,Lr|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Yr(e,t,n,a){return rs(e,t,n,a),os(e)}function Ma(e,t){return rs(e,null,null,t),os(e)}function Xu(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var s=!1,r=e.return;r!==null;)r.childLanes|=n,a=r.alternate,a!==null&&(a.childLanes|=n),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(s=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,s&&t!==null&&(s=31-jt(n),e=r.hiddenUpdates,a=e[s],a===null?e[s]=[t]:a.push(t),t.lane=n|536870912),r):null}function os(e){if(50<Si)throw Si=0,Io=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var rl={};function lm(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rt(e,t,n,a){return new lm(e,t,n,a)}function Gr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function En(e,t){var n=e.alternate;return n===null?(n=Rt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Vu(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function cs(e,t,n,a,s,r){var f=0;if(a=e,typeof e=="function")Gr(e)&&(f=1);else if(typeof e=="string")f=cg(e,n,F.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case G:return e=Rt(31,n,t,s),e.elementType=G,e.lanes=r,e;case X:return Ea(n.children,s,r,t);case M:f=8,s|=24;break;case z:return e=Rt(12,n,t,s|2),e.elementType=z,e.lanes=r,e;case re:return e=Rt(13,n,t,s),e.elementType=re,e.lanes=r,e;case B:return e=Rt(19,n,t,s),e.elementType=B,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case N:f=10;break e;case R:f=9;break e;case Z:f=11;break e;case L:f=14;break e;case P:f=16,a=null;break e}f=29,n=Error(o(130,e===null?"null":typeof e,"")),a=null}return t=Rt(f,n,t,s),t.elementType=e,t.type=a,t.lanes=r,t}function Ea(e,t,n,a){return e=Rt(7,e,a,t),e.lanes=n,e}function Wr(e,t,n){return e=Rt(6,e,null,t),e.lanes=n,e}function Qu(e){var t=Rt(18,null,null,0);return t.stateNode=e,t}function Xr(e,t,n){return t=Rt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ku=new WeakMap;function Xt(e,t){if(typeof e=="object"&&e!==null){var n=Ku.get(e);return n!==void 0?n:(t={value:e,source:t,stack:rn(t)},Ku.set(e,t),t)}return{value:e,source:t,stack:rn(t)}}var ol=[],cl=0,us=null,ti=0,Vt=[],Qt=0,Zn=null,un=1,dn="";function _n(e,t){ol[cl++]=ti,ol[cl++]=us,us=e,ti=t}function Zu(e,t,n){Vt[Qt++]=un,Vt[Qt++]=dn,Vt[Qt++]=Zn,Zn=e;var a=un;e=dn;var s=32-jt(a)-1;a&=~(1<<s),n+=1;var r=32-jt(t)+s;if(30<r){var f=s-s%5;r=(a&(1<<f)-1).toString(32),a>>=f,s-=f,un=1<<32-jt(t)+s|n<<s|a,dn=r+e}else un=1<<r|n<<s|a,dn=e}function Vr(e){e.return!==null&&(_n(e,1),Zu(e,1,0))}function Qr(e){for(;e===us;)us=ol[--cl],ol[cl]=null,ti=ol[--cl],ol[cl]=null;for(;e===Zn;)Zn=Vt[--Qt],Vt[Qt]=null,dn=Vt[--Qt],Vt[Qt]=null,un=Vt[--Qt],Vt[Qt]=null}function Fu(e,t){Vt[Qt++]=un,Vt[Qt++]=dn,Vt[Qt++]=Zn,un=t.id,dn=t.overflow,Zn=e}var ut=null,Xe=null,De=!1,Fn=null,Kt=!1,Kr=Error(o(519));function Jn(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ni(Xt(t,e)),Kr}function Ju(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Je]=e,t[gt]=a,n){case"dialog":Me("cancel",t),Me("close",t);break;case"iframe":case"object":case"embed":Me("load",t);break;case"video":case"audio":for(n=0;n<wi.length;n++)Me(wi[n],t);break;case"source":Me("error",t);break;case"img":case"image":case"link":Me("error",t),Me("load",t);break;case"details":Me("toggle",t);break;case"input":Me("invalid",t),uu(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Me("invalid",t);break;case"textarea":Me("invalid",t),fu(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||vh(t.textContent,n)?(a.popover!=null&&(Me("beforetoggle",t),Me("toggle",t)),a.onScroll!=null&&Me("scroll",t),a.onScrollEnd!=null&&Me("scrollend",t),a.onClick!=null&&(t.onclick=Tn),t=!0):t=!1,t||Jn(e,!0)}function Iu(e){for(ut=e.return;ut;)switch(ut.tag){case 5:case 31:case 13:Kt=!1;return;case 27:case 3:Kt=!0;return;default:ut=ut.return}}function ul(e){if(e!==ut)return!1;if(!De)return Iu(e),De=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||hc(e.type,e.memoizedProps)),n=!n),n&&Xe&&Jn(e),Iu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Xe=wh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Xe=wh(e)}else t===27?(t=Xe,da(e.type)?(e=yc,yc=null,Xe=e):Xe=t):Xe=ut?Ft(e.stateNode.nextSibling):null;return!0}function _a(){Xe=ut=null,De=!1}function Zr(){var e=Fn;return e!==null&&(_t===null?_t=e:_t.push.apply(_t,e),Fn=null),e}function ni(e){Fn===null?Fn=[e]:Fn.push(e)}var Fr=T(null),Da=null,Dn=null;function In(e,t,n){A(Fr,t._currentValue),t._currentValue=n}function An(e){e._currentValue=Fr.current,Q(Fr)}function Jr(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function Ir(e,t,n,a){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var r=s.dependencies;if(r!==null){var f=s.child;r=r.firstContext;e:for(;r!==null;){var v=r;r=s;for(var C=0;C<t.length;C++)if(v.context===t[C]){r.lanes|=n,v=r.alternate,v!==null&&(v.lanes|=n),Jr(r.return,n,e),a||(f=null);break e}r=v.next}}else if(s.tag===18){if(f=s.return,f===null)throw Error(o(341));f.lanes|=n,r=f.alternate,r!==null&&(r.lanes|=n),Jr(f,n,e),f=null}else f=s.child;if(f!==null)f.return=s;else for(f=s;f!==null;){if(f===e){f=null;break}if(s=f.sibling,s!==null){s.return=f.return,f=s;break}f=f.return}s=f}}function dl(e,t,n,a){e=null;for(var s=t,r=!1;s!==null;){if(!r){if((s.flags&524288)!==0)r=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var f=s.alternate;if(f===null)throw Error(o(387));if(f=f.memoizedProps,f!==null){var v=s.type;At(s.pendingProps.value,f.value)||(e!==null?e.push(v):e=[v])}}else if(s===je.current){if(f=s.alternate,f===null)throw Error(o(387));f.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(Ei):e=[Ei])}s=s.return}e!==null&&Ir(t,e,n,a),t.flags|=262144}function ds(e){for(e=e.firstContext;e!==null;){if(!At(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Aa(e){Da=e,Dn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function dt(e){return Pu(Da,e)}function fs(e,t){return Da===null&&Aa(e),Pu(e,t)}function Pu(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Dn===null){if(e===null)throw Error(o(308));Dn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Dn=Dn.next=t;return n}var im=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},sm=i.unstable_scheduleCallback,rm=i.unstable_NormalPriority,lt={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pr(){return{controller:new im,data:new Map,refCount:0}}function ai(e){e.refCount--,e.refCount===0&&sm(rm,function(){e.controller.abort()})}var li=null,eo=0,fl=0,hl=null;function om(e,t){if(li===null){var n=li=[];eo=0,fl=lc(),hl={status:"pending",value:void 0,then:function(a){n.push(a)}}}return eo++,t.then(ed,ed),t}function ed(){if(--eo===0&&li!==null){hl!==null&&(hl.status="fulfilled");var e=li;li=null,fl=0,hl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function cm(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(s){n.push(s)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var s=0;s<n.length;s++)(0,n[s])(t)},function(s){for(a.status="rejected",a.reason=s,s=0;s<n.length;s++)(0,n[s])(void 0)}),a}var td=j.S;j.S=function(e,t){$f=bt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&om(e,t),td!==null&&td(e,t)};var Ra=T(null);function to(){var e=Ra.current;return e!==null?e:We.pooledCache}function hs(e,t){t===null?A(Ra,Ra.current):A(Ra,t.pool)}function nd(){var e=to();return e===null?null:{parent:lt._currentValue,pool:e}}var pl=Error(o(460)),no=Error(o(474)),ps=Error(o(542)),vs={then:function(){}};function ad(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ld(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Tn,Tn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,sd(e),e;default:if(typeof t.status=="string")t.then(Tn,Tn);else{if(e=We,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=a}},function(a){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,sd(e),e}throw Na=t,pl}}function Oa(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Na=n,pl):n}}var Na=null;function id(){if(Na===null)throw Error(o(459));var e=Na;return Na=null,e}function sd(e){if(e===pl||e===ps)throw Error(o(483))}var vl=null,ii=0;function ms(e){var t=ii;return ii+=1,vl===null&&(vl=[]),ld(vl,e,t)}function si(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function gs(e,t){throw t.$$typeof===k?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function rd(e){function t(D,E){if(e){var U=D.deletions;U===null?(D.deletions=[E],D.flags|=16):U.push(E)}}function n(D,E){if(!e)return null;for(;E!==null;)t(D,E),E=E.sibling;return null}function a(D){for(var E=new Map;D!==null;)D.key!==null?E.set(D.key,D):E.set(D.index,D),D=D.sibling;return E}function s(D,E){return D=En(D,E),D.index=0,D.sibling=null,D}function r(D,E,U){return D.index=U,e?(U=D.alternate,U!==null?(U=U.index,U<E?(D.flags|=67108866,E):U):(D.flags|=67108866,E)):(D.flags|=1048576,E)}function f(D){return e&&D.alternate===null&&(D.flags|=67108866),D}function v(D,E,U,K){return E===null||E.tag!==6?(E=Wr(U,D.mode,K),E.return=D,E):(E=s(E,U),E.return=D,E)}function C(D,E,U,K){var ve=U.type;return ve===X?V(D,E,U.props.children,K,U.key):E!==null&&(E.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===P&&Oa(ve)===E.type)?(E=s(E,U.props),si(E,U),E.return=D,E):(E=cs(U.type,U.key,U.props,null,D.mode,K),si(E,U),E.return=D,E)}function H(D,E,U,K){return E===null||E.tag!==4||E.stateNode.containerInfo!==U.containerInfo||E.stateNode.implementation!==U.implementation?(E=Xr(U,D.mode,K),E.return=D,E):(E=s(E,U.children||[]),E.return=D,E)}function V(D,E,U,K,ve){return E===null||E.tag!==7?(E=Ea(U,D.mode,K,ve),E.return=D,E):(E=s(E,U),E.return=D,E)}function J(D,E,U){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return E=Wr(""+E,D.mode,U),E.return=D,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case w:return U=cs(E.type,E.key,E.props,null,D.mode,U),si(U,E),U.return=D,U;case _:return E=Xr(E,D.mode,U),E.return=D,E;case P:return E=Oa(E),J(D,E,U)}if(me(E)||ee(E))return E=Ea(E,D.mode,U,null),E.return=D,E;if(typeof E.then=="function")return J(D,ms(E),U);if(E.$$typeof===N)return J(D,fs(D,E),U);gs(D,E)}return null}function $(D,E,U,K){var ve=E!==null?E.key:null;if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return ve!==null?null:v(D,E,""+U,K);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case w:return U.key===ve?C(D,E,U,K):null;case _:return U.key===ve?H(D,E,U,K):null;case P:return U=Oa(U),$(D,E,U,K)}if(me(U)||ee(U))return ve!==null?null:V(D,E,U,K,null);if(typeof U.then=="function")return $(D,E,ms(U),K);if(U.$$typeof===N)return $(D,E,fs(D,U),K);gs(D,U)}return null}function Y(D,E,U,K,ve){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return D=D.get(U)||null,v(E,D,""+K,ve);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case w:return D=D.get(K.key===null?U:K.key)||null,C(E,D,K,ve);case _:return D=D.get(K.key===null?U:K.key)||null,H(E,D,K,ve);case P:return K=Oa(K),Y(D,E,U,K,ve)}if(me(K)||ee(K))return D=D.get(U)||null,V(E,D,K,ve,null);if(typeof K.then=="function")return Y(D,E,U,ms(K),ve);if(K.$$typeof===N)return Y(D,E,U,fs(E,K),ve);gs(E,K)}return null}function fe(D,E,U,K){for(var ve=null,Re=null,pe=E,we=E=0,_e=null;pe!==null&&we<U.length;we++){pe.index>we?(_e=pe,pe=null):_e=pe.sibling;var Oe=$(D,pe,U[we],K);if(Oe===null){pe===null&&(pe=_e);break}e&&pe&&Oe.alternate===null&&t(D,pe),E=r(Oe,E,we),Re===null?ve=Oe:Re.sibling=Oe,Re=Oe,pe=_e}if(we===U.length)return n(D,pe),De&&_n(D,we),ve;if(pe===null){for(;we<U.length;we++)pe=J(D,U[we],K),pe!==null&&(E=r(pe,E,we),Re===null?ve=pe:Re.sibling=pe,Re=pe);return De&&_n(D,we),ve}for(pe=a(pe);we<U.length;we++)_e=Y(pe,D,we,U[we],K),_e!==null&&(e&&_e.alternate!==null&&pe.delete(_e.key===null?we:_e.key),E=r(_e,E,we),Re===null?ve=_e:Re.sibling=_e,Re=_e);return e&&pe.forEach(function(ma){return t(D,ma)}),De&&_n(D,we),ve}function ye(D,E,U,K){if(U==null)throw Error(o(151));for(var ve=null,Re=null,pe=E,we=E=0,_e=null,Oe=U.next();pe!==null&&!Oe.done;we++,Oe=U.next()){pe.index>we?(_e=pe,pe=null):_e=pe.sibling;var ma=$(D,pe,Oe.value,K);if(ma===null){pe===null&&(pe=_e);break}e&&pe&&ma.alternate===null&&t(D,pe),E=r(ma,E,we),Re===null?ve=ma:Re.sibling=ma,Re=ma,pe=_e}if(Oe.done)return n(D,pe),De&&_n(D,we),ve;if(pe===null){for(;!Oe.done;we++,Oe=U.next())Oe=J(D,Oe.value,K),Oe!==null&&(E=r(Oe,E,we),Re===null?ve=Oe:Re.sibling=Oe,Re=Oe);return De&&_n(D,we),ve}for(pe=a(pe);!Oe.done;we++,Oe=U.next())Oe=Y(pe,D,we,Oe.value,K),Oe!==null&&(e&&Oe.alternate!==null&&pe.delete(Oe.key===null?we:Oe.key),E=r(Oe,E,we),Re===null?ve=Oe:Re.sibling=Oe,Re=Oe);return e&&pe.forEach(function(bg){return t(D,bg)}),De&&_n(D,we),ve}function Ge(D,E,U,K){if(typeof U=="object"&&U!==null&&U.type===X&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case w:e:{for(var ve=U.key;E!==null;){if(E.key===ve){if(ve=U.type,ve===X){if(E.tag===7){n(D,E.sibling),K=s(E,U.props.children),K.return=D,D=K;break e}}else if(E.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===P&&Oa(ve)===E.type){n(D,E.sibling),K=s(E,U.props),si(K,U),K.return=D,D=K;break e}n(D,E);break}else t(D,E);E=E.sibling}U.type===X?(K=Ea(U.props.children,D.mode,K,U.key),K.return=D,D=K):(K=cs(U.type,U.key,U.props,null,D.mode,K),si(K,U),K.return=D,D=K)}return f(D);case _:e:{for(ve=U.key;E!==null;){if(E.key===ve)if(E.tag===4&&E.stateNode.containerInfo===U.containerInfo&&E.stateNode.implementation===U.implementation){n(D,E.sibling),K=s(E,U.children||[]),K.return=D,D=K;break e}else{n(D,E);break}else t(D,E);E=E.sibling}K=Xr(U,D.mode,K),K.return=D,D=K}return f(D);case P:return U=Oa(U),Ge(D,E,U,K)}if(me(U))return fe(D,E,U,K);if(ee(U)){if(ve=ee(U),typeof ve!="function")throw Error(o(150));return U=ve.call(U),ye(D,E,U,K)}if(typeof U.then=="function")return Ge(D,E,ms(U),K);if(U.$$typeof===N)return Ge(D,E,fs(D,U),K);gs(D,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,E!==null&&E.tag===6?(n(D,E.sibling),K=s(E,U),K.return=D,D=K):(n(D,E),K=Wr(U,D.mode,K),K.return=D,D=K),f(D)):n(D,E)}return function(D,E,U,K){try{ii=0;var ve=Ge(D,E,U,K);return vl=null,ve}catch(pe){if(pe===pl||pe===ps)throw pe;var Re=Rt(29,pe,null,D.mode);return Re.lanes=K,Re.return=D,Re}}}var Ua=rd(!0),od=rd(!1),Pn=!1;function ao(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ea(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ta(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Ne&2)!==0){var s=a.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),a.pending=t,t=os(e),Xu(e,null,n),t}return rs(e,a,t,n),os(e)}function ri(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,jn(e,n)}}function io(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var s=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var f={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?s=r=f:r=r.next=f,n=n.next}while(n!==null);r===null?s=r=t:r=r.next=t}else s=r=t;n={baseState:a.baseState,firstBaseUpdate:s,lastBaseUpdate:r,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var so=!1;function oi(){if(so){var e=hl;if(e!==null)throw e}}function ci(e,t,n,a){so=!1;var s=e.updateQueue;Pn=!1;var r=s.firstBaseUpdate,f=s.lastBaseUpdate,v=s.shared.pending;if(v!==null){s.shared.pending=null;var C=v,H=C.next;C.next=null,f===null?r=H:f.next=H,f=C;var V=e.alternate;V!==null&&(V=V.updateQueue,v=V.lastBaseUpdate,v!==f&&(v===null?V.firstBaseUpdate=H:v.next=H,V.lastBaseUpdate=C))}if(r!==null){var J=s.baseState;f=0,V=H=C=null,v=r;do{var $=v.lane&-536870913,Y=$!==v.lane;if(Y?(Ee&$)===$:(a&$)===$){$!==0&&$===fl&&(so=!0),V!==null&&(V=V.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var fe=e,ye=v;$=t;var Ge=n;switch(ye.tag){case 1:if(fe=ye.payload,typeof fe=="function"){J=fe.call(Ge,J,$);break e}J=fe;break e;case 3:fe.flags=fe.flags&-65537|128;case 0:if(fe=ye.payload,$=typeof fe=="function"?fe.call(Ge,J,$):fe,$==null)break e;J=b({},J,$);break e;case 2:Pn=!0}}$=v.callback,$!==null&&(e.flags|=64,Y&&(e.flags|=8192),Y=s.callbacks,Y===null?s.callbacks=[$]:Y.push($))}else Y={lane:$,tag:v.tag,payload:v.payload,callback:v.callback,next:null},V===null?(H=V=Y,C=J):V=V.next=Y,f|=$;if(v=v.next,v===null){if(v=s.shared.pending,v===null)break;Y=v,v=Y.next,Y.next=null,s.lastBaseUpdate=Y,s.shared.pending=null}}while(!0);V===null&&(C=J),s.baseState=C,s.firstBaseUpdate=H,s.lastBaseUpdate=V,r===null&&(s.shared.lanes=0),sa|=f,e.lanes=f,e.memoizedState=J}}function cd(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function ud(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)cd(n[e],t)}var ml=T(null),ys=T(0);function dd(e,t){e=Ln,A(ys,e),A(ml,t),Ln=e|t.baseLanes}function ro(){A(ys,Ln),A(ml,ml.current)}function oo(){Ln=ys.current,Q(ml),Q(ys)}var Ot=T(null),Zt=null;function na(e){var t=e.alternate;A(tt,tt.current&1),A(Ot,e),Zt===null&&(t===null||ml.current!==null||t.memoizedState!==null)&&(Zt=e)}function co(e){A(tt,tt.current),A(Ot,e),Zt===null&&(Zt=e)}function fd(e){e.tag===22?(A(tt,tt.current),A(Ot,e),Zt===null&&(Zt=e)):aa()}function aa(){A(tt,tt.current),A(Ot,Ot.current)}function Nt(e){Q(Ot),Zt===e&&(Zt=null),Q(tt)}var tt=T(0);function xs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||mc(n)||gc(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Rn=0,ke=null,Le=null,it=null,bs=!1,gl=!1,Ha=!1,js=0,ui=0,yl=null,um=0;function Ie(){throw Error(o(321))}function uo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!At(e[n],t[n]))return!1;return!0}function fo(e,t,n,a,s,r){return Rn=r,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?Zd:To,Ha=!1,r=n(a,s),Ha=!1,gl&&(r=pd(t,n,a,s)),hd(e),r}function hd(e){j.H=hi;var t=Le!==null&&Le.next!==null;if(Rn=0,it=Le=ke=null,bs=!1,ui=0,yl=null,t)throw Error(o(300));e===null||st||(e=e.dependencies,e!==null&&ds(e)&&(st=!0))}function pd(e,t,n,a){ke=e;var s=0;do{if(gl&&(yl=null),ui=0,gl=!1,25<=s)throw Error(o(301));if(s+=1,it=Le=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}j.H=Fd,r=t(n,a)}while(gl);return r}function dm(){var e=j.H,t=e.useState()[0];return t=typeof t.then=="function"?di(t):t,e=e.useState()[0],(Le!==null?Le.memoizedState:null)!==e&&(ke.flags|=1024),t}function ho(){var e=js!==0;return js=0,e}function po(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function vo(e){if(bs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}bs=!1}Rn=0,it=Le=ke=null,gl=!1,ui=js=0,yl=null}function kt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return it===null?ke.memoizedState=it=e:it=it.next=e,it}function nt(){if(Le===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=Le.next;var t=it===null?ke.memoizedState:it.next;if(t!==null)it=t,Le=e;else{if(e===null)throw ke.alternate===null?Error(o(467)):Error(o(310));Le=e,e={memoizedState:Le.memoizedState,baseState:Le.baseState,baseQueue:Le.baseQueue,queue:Le.queue,next:null},it===null?ke.memoizedState=it=e:it=it.next=e}return it}function Ss(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function di(e){var t=ui;return ui+=1,yl===null&&(yl=[]),e=ld(yl,e,t),t=ke,(it===null?t.memoizedState:it.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?Zd:To),e}function ks(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return di(e);if(e.$$typeof===N)return dt(e)}throw Error(o(438,String(e)))}function mo(e){var t=null,n=ke.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=ke.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Ss(),ke.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=ce;return t.index++,n}function On(e,t){return typeof t=="function"?t(e):t}function ws(e){var t=nt();return go(t,Le,e)}function go(e,t,n){var a=e.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=n;var s=e.baseQueue,r=a.pending;if(r!==null){if(s!==null){var f=s.next;s.next=r.next,r.next=f}t.baseQueue=s=r,a.pending=null}if(r=e.baseState,s===null)e.memoizedState=r;else{t=s.next;var v=f=null,C=null,H=t,V=!1;do{var J=H.lane&-536870913;if(J!==H.lane?(Ee&J)===J:(Rn&J)===J){var $=H.revertLane;if($===0)C!==null&&(C=C.next={lane:0,revertLane:0,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null}),J===fl&&(V=!0);else if((Rn&$)===$){H=H.next,$===fl&&(V=!0);continue}else J={lane:0,revertLane:H.revertLane,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},C===null?(v=C=J,f=r):C=C.next=J,ke.lanes|=$,sa|=$;J=H.action,Ha&&n(r,J),r=H.hasEagerState?H.eagerState:n(r,J)}else $={lane:J,revertLane:H.revertLane,gesture:H.gesture,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},C===null?(v=C=$,f=r):C=C.next=$,ke.lanes|=J,sa|=J;H=H.next}while(H!==null&&H!==t);if(C===null?f=r:C.next=v,!At(r,e.memoizedState)&&(st=!0,V&&(n=hl,n!==null)))throw n;e.memoizedState=r,e.baseState=f,e.baseQueue=C,a.lastRenderedState=r}return s===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function yo(e){var t=nt(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var a=n.dispatch,s=n.pending,r=t.memoizedState;if(s!==null){n.pending=null;var f=s=s.next;do r=e(r,f.action),f=f.next;while(f!==s);At(r,t.memoizedState)||(st=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),n.lastRenderedState=r}return[r,a]}function vd(e,t,n){var a=ke,s=nt(),r=De;if(r){if(n===void 0)throw Error(o(407));n=n()}else n=t();var f=!At((Le||s).memoizedState,n);if(f&&(s.memoizedState=n,st=!0),s=s.queue,jo(yd.bind(null,a,s,e),[e]),s.getSnapshot!==t||f||it!==null&&it.memoizedState.tag&1){if(a.flags|=2048,xl(9,{destroy:void 0},gd.bind(null,a,s,n,t),null),We===null)throw Error(o(349));r||(Rn&127)!==0||md(a,t,n)}return n}function md(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ke.updateQueue,t===null?(t=Ss(),ke.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function gd(e,t,n,a){t.value=n,t.getSnapshot=a,xd(t)&&bd(e)}function yd(e,t,n){return n(function(){xd(t)&&bd(e)})}function xd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!At(e,n)}catch{return!0}}function bd(e){var t=Ma(e,2);t!==null&&Dt(t,e,2)}function xo(e){var t=kt();if(typeof e=="function"){var n=e;if(e=n(),Ha){en(!0);try{n()}finally{en(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:On,lastRenderedState:e},t}function jd(e,t,n,a){return e.baseState=n,go(e,Le,typeof a=="function"?a:On)}function fm(e,t,n,a,s){if(Ts(e))throw Error(o(485));if(e=t.action,e!==null){var r={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){r.listeners.push(f)}};j.T!==null?n(!0):r.isTransition=!1,a(r),n=t.pending,n===null?(r.next=t.pending=r,Sd(t,r)):(r.next=n.next,t.pending=n.next=r)}}function Sd(e,t){var n=t.action,a=t.payload,s=e.state;if(t.isTransition){var r=j.T,f={};j.T=f;try{var v=n(s,a),C=j.S;C!==null&&C(f,v),kd(e,t,v)}catch(H){bo(e,t,H)}finally{r!==null&&f.types!==null&&(r.types=f.types),j.T=r}}else try{r=n(s,a),kd(e,t,r)}catch(H){bo(e,t,H)}}function kd(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){wd(e,t,a)},function(a){return bo(e,t,a)}):wd(e,t,n)}function wd(e,t,n){t.status="fulfilled",t.value=n,zd(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Sd(e,n)))}function bo(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,zd(t),t=t.next;while(t!==a)}e.action=null}function zd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Cd(e,t){return t}function Td(e,t){if(De){var n=We.formState;if(n!==null){e:{var a=ke;if(De){if(Xe){t:{for(var s=Xe,r=Kt;s.nodeType!==8;){if(!r){s=null;break t}if(s=Ft(s.nextSibling),s===null){s=null;break t}}r=s.data,s=r==="F!"||r==="F"?s:null}if(s){Xe=Ft(s.nextSibling),a=s.data==="F!";break e}}Jn(a)}a=!1}a&&(t=n[0])}}return n=kt(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cd,lastRenderedState:t},n.queue=a,n=Vd.bind(null,ke,a),a.dispatch=n,a=xo(!1),r=Co.bind(null,ke,!1,a.queue),a=kt(),s={state:t,dispatch:null,action:e,pending:null},a.queue=s,n=fm.bind(null,ke,s,r,n),s.dispatch=n,a.memoizedState=e,[t,n,!1]}function Md(e){var t=nt();return Ed(t,Le,e)}function Ed(e,t,n){if(t=go(e,t,Cd)[0],e=ws(On)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=di(t)}catch(f){throw f===pl?ps:f}else a=t;t=nt();var s=t.queue,r=s.dispatch;return n!==t.memoizedState&&(ke.flags|=2048,xl(9,{destroy:void 0},hm.bind(null,s,n),null)),[a,r,e]}function hm(e,t){e.action=t}function _d(e){var t=nt(),n=Le;if(n!==null)return Ed(t,n,e);nt(),t=t.memoizedState,n=nt();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function xl(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=ke.updateQueue,t===null&&(t=Ss(),ke.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function Dd(){return nt().memoizedState}function zs(e,t,n,a){var s=kt();ke.flags|=e,s.memoizedState=xl(1|t,{destroy:void 0},n,a===void 0?null:a)}function Cs(e,t,n,a){var s=nt();a=a===void 0?null:a;var r=s.memoizedState.inst;Le!==null&&a!==null&&uo(a,Le.memoizedState.deps)?s.memoizedState=xl(t,r,n,a):(ke.flags|=e,s.memoizedState=xl(1|t,r,n,a))}function Ad(e,t){zs(8390656,8,e,t)}function jo(e,t){Cs(2048,8,e,t)}function pm(e){ke.flags|=4;var t=ke.updateQueue;if(t===null)t=Ss(),ke.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Rd(e){var t=nt().memoizedState;return pm({ref:t,nextImpl:e}),function(){if((Ne&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Od(e,t){return Cs(4,2,e,t)}function Nd(e,t){return Cs(4,4,e,t)}function Ud(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Hd(e,t,n){n=n!=null?n.concat([e]):null,Cs(4,4,Ud.bind(null,t,e),n)}function So(){}function Bd(e,t){var n=nt();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&uo(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function $d(e,t){var n=nt();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&uo(t,a[1]))return a[0];if(a=e(),Ha){en(!0);try{e()}finally{en(!1)}}return n.memoizedState=[a,t],a}function ko(e,t,n){return n===void 0||(Rn&1073741824)!==0&&(Ee&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Lf(),ke.lanes|=e,sa|=e,n)}function qd(e,t,n,a){return At(n,t)?n:ml.current!==null?(e=ko(e,n,a),At(e,t)||(st=!0),e):(Rn&42)===0||(Rn&1073741824)!==0&&(Ee&261930)===0?(st=!0,e.memoizedState=n):(e=Lf(),ke.lanes|=e,sa|=e,t)}function Ld(e,t,n,a,s){var r=q.p;q.p=r!==0&&8>r?r:8;var f=j.T,v={};j.T=v,Co(e,!1,t,n);try{var C=s(),H=j.S;if(H!==null&&H(v,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var V=cm(C,a);fi(e,t,V,Bt(e))}else fi(e,t,a,Bt(e))}catch(J){fi(e,t,{then:function(){},status:"rejected",reason:J},Bt())}finally{q.p=r,f!==null&&v.types!==null&&(f.types=v.types),j.T=f}}function vm(){}function wo(e,t,n,a){if(e.tag!==5)throw Error(o(476));var s=Yd(e).queue;Ld(e,s,t,O,n===null?vm:function(){return Gd(e),n(a)})}function Yd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:O,baseState:O,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:On,lastRenderedState:O},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:On,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Gd(e){var t=Yd(e);t.next===null&&(t=e.alternate.memoizedState),fi(e,t.next.queue,{},Bt())}function zo(){return dt(Ei)}function Wd(){return nt().memoizedState}function Xd(){return nt().memoizedState}function mm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Bt();e=ea(n);var a=ta(t,e,n);a!==null&&(Dt(a,t,n),ri(a,t,n)),t={cache:Pr()},e.payload=t;return}t=t.return}}function gm(e,t,n){var a=Bt();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ts(e)?Qd(t,n):(n=Yr(e,t,n,a),n!==null&&(Dt(n,e,a),Kd(n,t,a)))}function Vd(e,t,n){var a=Bt();fi(e,t,n,a)}function fi(e,t,n,a){var s={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ts(e))Qd(t,s);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var f=t.lastRenderedState,v=r(f,n);if(s.hasEagerState=!0,s.eagerState=v,At(v,f))return rs(e,t,s,0),We===null&&ss(),!1}catch{}if(n=Yr(e,t,s,a),n!==null)return Dt(n,e,a),Kd(n,t,a),!0}return!1}function Co(e,t,n,a){if(a={lane:2,revertLane:lc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ts(e)){if(t)throw Error(o(479))}else t=Yr(e,n,a,2),t!==null&&Dt(t,e,2)}function Ts(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function Qd(e,t){gl=bs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Kd(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,jn(e,n)}}var hi={readContext:dt,use:ks,useCallback:Ie,useContext:Ie,useEffect:Ie,useImperativeHandle:Ie,useLayoutEffect:Ie,useInsertionEffect:Ie,useMemo:Ie,useReducer:Ie,useRef:Ie,useState:Ie,useDebugValue:Ie,useDeferredValue:Ie,useTransition:Ie,useSyncExternalStore:Ie,useId:Ie,useHostTransitionStatus:Ie,useFormState:Ie,useActionState:Ie,useOptimistic:Ie,useMemoCache:Ie,useCacheRefresh:Ie};hi.useEffectEvent=Ie;var Zd={readContext:dt,use:ks,useCallback:function(e,t){return kt().memoizedState=[e,t===void 0?null:t],e},useContext:dt,useEffect:Ad,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,zs(4194308,4,Ud.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zs(4194308,4,e,t)},useInsertionEffect:function(e,t){zs(4,2,e,t)},useMemo:function(e,t){var n=kt();t=t===void 0?null:t;var a=e();if(Ha){en(!0);try{e()}finally{en(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=kt();if(n!==void 0){var s=n(t);if(Ha){en(!0);try{n(t)}finally{en(!1)}}}else s=t;return a.memoizedState=a.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},a.queue=e,e=e.dispatch=gm.bind(null,ke,e),[a.memoizedState,e]},useRef:function(e){var t=kt();return e={current:e},t.memoizedState=e},useState:function(e){e=xo(e);var t=e.queue,n=Vd.bind(null,ke,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:So,useDeferredValue:function(e,t){var n=kt();return ko(n,e,t)},useTransition:function(){var e=xo(!1);return e=Ld.bind(null,ke,e.queue,!0,!1),kt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=ke,s=kt();if(De){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),We===null)throw Error(o(349));(Ee&127)!==0||md(a,t,n)}s.memoizedState=n;var r={value:n,getSnapshot:t};return s.queue=r,Ad(yd.bind(null,a,r,e),[e]),a.flags|=2048,xl(9,{destroy:void 0},gd.bind(null,a,r,n,t),null),n},useId:function(){var e=kt(),t=We.identifierPrefix;if(De){var n=dn,a=un;n=(a&~(1<<32-jt(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=js++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=um++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:zo,useFormState:Td,useActionState:Td,useOptimistic:function(e){var t=kt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Co.bind(null,ke,!0,n),n.dispatch=t,[e,t]},useMemoCache:mo,useCacheRefresh:function(){return kt().memoizedState=mm.bind(null,ke)},useEffectEvent:function(e){var t=kt(),n={impl:e};return t.memoizedState=n,function(){if((Ne&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},To={readContext:dt,use:ks,useCallback:Bd,useContext:dt,useEffect:jo,useImperativeHandle:Hd,useInsertionEffect:Od,useLayoutEffect:Nd,useMemo:$d,useReducer:ws,useRef:Dd,useState:function(){return ws(On)},useDebugValue:So,useDeferredValue:function(e,t){var n=nt();return qd(n,Le.memoizedState,e,t)},useTransition:function(){var e=ws(On)[0],t=nt().memoizedState;return[typeof e=="boolean"?e:di(e),t]},useSyncExternalStore:vd,useId:Wd,useHostTransitionStatus:zo,useFormState:Md,useActionState:Md,useOptimistic:function(e,t){var n=nt();return jd(n,Le,e,t)},useMemoCache:mo,useCacheRefresh:Xd};To.useEffectEvent=Rd;var Fd={readContext:dt,use:ks,useCallback:Bd,useContext:dt,useEffect:jo,useImperativeHandle:Hd,useInsertionEffect:Od,useLayoutEffect:Nd,useMemo:$d,useReducer:yo,useRef:Dd,useState:function(){return yo(On)},useDebugValue:So,useDeferredValue:function(e,t){var n=nt();return Le===null?ko(n,e,t):qd(n,Le.memoizedState,e,t)},useTransition:function(){var e=yo(On)[0],t=nt().memoizedState;return[typeof e=="boolean"?e:di(e),t]},useSyncExternalStore:vd,useId:Wd,useHostTransitionStatus:zo,useFormState:_d,useActionState:_d,useOptimistic:function(e,t){var n=nt();return Le!==null?jd(n,Le,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:mo,useCacheRefresh:Xd};Fd.useEffectEvent=Rd;function Mo(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:b({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Eo={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Bt(),s=ea(a);s.payload=t,n!=null&&(s.callback=n),t=ta(e,s,a),t!==null&&(Dt(t,e,a),ri(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Bt(),s=ea(a);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=ta(e,s,a),t!==null&&(Dt(t,e,a),ri(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Bt(),a=ea(n);a.tag=2,t!=null&&(a.callback=t),t=ta(e,a,n),t!==null&&(Dt(t,e,n),ri(t,e,n))}};function Jd(e,t,n,a,s,r,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,r,f):t.prototype&&t.prototype.isPureReactComponent?!Pl(n,a)||!Pl(s,r):!0}function Id(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&Eo.enqueueReplaceState(t,t.state,null)}function Ba(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=b({},n));for(var s in e)n[s]===void 0&&(n[s]=e[s])}return n}function Pd(e){is(e)}function ef(e){console.error(e)}function tf(e){is(e)}function Ms(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function nf(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function _o(e,t,n){return n=ea(n),n.tag=3,n.payload={element:null},n.callback=function(){Ms(e,t)},n}function af(e){return e=ea(e),e.tag=3,e}function lf(e,t,n,a){var s=n.type.getDerivedStateFromError;if(typeof s=="function"){var r=a.value;e.payload=function(){return s(r)},e.callback=function(){nf(t,n,a)}}var f=n.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){nf(t,n,a),typeof s!="function"&&(ra===null?ra=new Set([this]):ra.add(this));var v=a.stack;this.componentDidCatch(a.value,{componentStack:v!==null?v:""})})}function ym(e,t,n,a,s){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&dl(t,n,s,!0),n=Ot.current,n!==null){switch(n.tag){case 31:case 13:return Zt===null?qs():n.alternate===null&&Pe===0&&(Pe=3),n.flags&=-257,n.flags|=65536,n.lanes=s,a===vs?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),tc(e,a,s)),!1;case 22:return n.flags|=65536,a===vs?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),tc(e,a,s)),!1}throw Error(o(435,n.tag))}return tc(e,a,s),qs(),!1}if(De)return t=Ot.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,a!==Kr&&(e=Error(o(422),{cause:a}),ni(Xt(e,n)))):(a!==Kr&&(t=Error(o(423),{cause:a}),ni(Xt(t,n))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,a=Xt(a,n),s=_o(e.stateNode,a,s),io(e,s),Pe!==4&&(Pe=2)),!1;var r=Error(o(520),{cause:a});if(r=Xt(r,n),ji===null?ji=[r]:ji.push(r),Pe!==4&&(Pe=2),t===null)return!0;a=Xt(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=s&-s,n.lanes|=e,e=_o(n.stateNode,a,e),io(n,e),!1;case 1:if(t=n.type,r=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(ra===null||!ra.has(r))))return n.flags|=65536,s&=-s,n.lanes|=s,s=af(s),lf(s,e,n,a),io(n,s),!1}n=n.return}while(n!==null);return!1}var Do=Error(o(461)),st=!1;function ft(e,t,n,a){t.child=e===null?od(t,null,n,a):Ua(t,e.child,n,a)}function sf(e,t,n,a,s){n=n.render;var r=t.ref;if("ref"in a){var f={};for(var v in a)v!=="ref"&&(f[v]=a[v])}else f=a;return Aa(t),a=fo(e,t,n,f,r,s),v=ho(),e!==null&&!st?(po(e,t,s),Nn(e,t,s)):(De&&v&&Vr(t),t.flags|=1,ft(e,t,a,s),t.child)}function rf(e,t,n,a,s){if(e===null){var r=n.type;return typeof r=="function"&&!Gr(r)&&r.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=r,of(e,t,r,a,s)):(e=cs(n.type,null,a,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!$o(e,s)){var f=r.memoizedProps;if(n=n.compare,n=n!==null?n:Pl,n(f,a)&&e.ref===t.ref)return Nn(e,t,s)}return t.flags|=1,e=En(r,a),e.ref=t.ref,e.return=t,t.child=e}function of(e,t,n,a,s){if(e!==null){var r=e.memoizedProps;if(Pl(r,a)&&e.ref===t.ref)if(st=!1,t.pendingProps=a=r,$o(e,s))(e.flags&131072)!==0&&(st=!0);else return t.lanes=e.lanes,Nn(e,t,s)}return Ao(e,t,n,a,s)}function cf(e,t,n,a){var s=a.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|n:n,e!==null){for(a=t.child=e.child,s=0;a!==null;)s=s|a.lanes|a.childLanes,a=a.sibling;a=s&~r}else a=0,t.child=null;return uf(e,t,r,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&hs(t,r!==null?r.cachePool:null),r!==null?dd(t,r):ro(),fd(t);else return a=t.lanes=536870912,uf(e,t,r!==null?r.baseLanes|n:n,n,a)}else r!==null?(hs(t,r.cachePool),dd(t,r),aa(),t.memoizedState=null):(e!==null&&hs(t,null),ro(),aa());return ft(e,t,s,n),t.child}function pi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function uf(e,t,n,a,s){var r=to();return r=r===null?null:{parent:lt._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&hs(t,null),ro(),fd(t),e!==null&&dl(e,t,a,!0),t.childLanes=s,null}function Es(e,t){return t=Ds({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function df(e,t,n){return Ua(t,e.child,null,n),e=Es(t,t.pendingProps),e.flags|=2,Nt(t),t.memoizedState=null,e}function xm(e,t,n){var a=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(De){if(a.mode==="hidden")return e=Es(t,a),t.lanes=536870912,pi(null,e);if(co(t),(e=Xe)?(e=kh(e,Kt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zn!==null?{id:un,overflow:dn}:null,retryLane:536870912,hydrationErrors:null},n=Qu(e),n.return=t,t.child=n,ut=t,Xe=null)):e=null,e===null)throw Jn(t);return t.lanes=536870912,null}return Es(t,a)}var r=e.memoizedState;if(r!==null){var f=r.dehydrated;if(co(t),s)if(t.flags&256)t.flags&=-257,t=df(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(st||dl(e,t,n,!1),s=(n&e.childLanes)!==0,st||s){if(a=We,a!==null&&(f=Za(a,n),f!==0&&f!==r.retryLane))throw r.retryLane=f,Ma(e,f),Dt(a,e,f),Do;qs(),t=df(e,t,n)}else e=r.treeContext,Xe=Ft(f.nextSibling),ut=t,De=!0,Fn=null,Kt=!1,e!==null&&Fu(t,e),t=Es(t,a),t.flags|=4096;return t}return e=En(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function _s(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Ao(e,t,n,a,s){return Aa(t),n=fo(e,t,n,a,void 0,s),a=ho(),e!==null&&!st?(po(e,t,s),Nn(e,t,s)):(De&&a&&Vr(t),t.flags|=1,ft(e,t,n,s),t.child)}function ff(e,t,n,a,s,r){return Aa(t),t.updateQueue=null,n=pd(t,a,n,s),hd(e),a=ho(),e!==null&&!st?(po(e,t,r),Nn(e,t,r)):(De&&a&&Vr(t),t.flags|=1,ft(e,t,n,r),t.child)}function hf(e,t,n,a,s){if(Aa(t),t.stateNode===null){var r=rl,f=n.contextType;typeof f=="object"&&f!==null&&(r=dt(f)),r=new n(a,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Eo,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=a,r.state=t.memoizedState,r.refs={},ao(t),f=n.contextType,r.context=typeof f=="object"&&f!==null?dt(f):rl,r.state=t.memoizedState,f=n.getDerivedStateFromProps,typeof f=="function"&&(Mo(t,n,f,a),r.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(f=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),f!==r.state&&Eo.enqueueReplaceState(r,r.state,null),ci(t,a,r,s),oi(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){r=t.stateNode;var v=t.memoizedProps,C=Ba(n,v);r.props=C;var H=r.context,V=n.contextType;f=rl,typeof V=="object"&&V!==null&&(f=dt(V));var J=n.getDerivedStateFromProps;V=typeof J=="function"||typeof r.getSnapshotBeforeUpdate=="function",v=t.pendingProps!==v,V||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(v||H!==f)&&Id(t,r,a,f),Pn=!1;var $=t.memoizedState;r.state=$,ci(t,a,r,s),oi(),H=t.memoizedState,v||$!==H||Pn?(typeof J=="function"&&(Mo(t,n,J,a),H=t.memoizedState),(C=Pn||Jd(t,n,C,a,$,H,f))?(V||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=H),r.props=a,r.state=H,r.context=f,a=C):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{r=t.stateNode,lo(e,t),f=t.memoizedProps,V=Ba(n,f),r.props=V,J=t.pendingProps,$=r.context,H=n.contextType,C=rl,typeof H=="object"&&H!==null&&(C=dt(H)),v=n.getDerivedStateFromProps,(H=typeof v=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(f!==J||$!==C)&&Id(t,r,a,C),Pn=!1,$=t.memoizedState,r.state=$,ci(t,a,r,s),oi();var Y=t.memoizedState;f!==J||$!==Y||Pn||e!==null&&e.dependencies!==null&&ds(e.dependencies)?(typeof v=="function"&&(Mo(t,n,v,a),Y=t.memoizedState),(V=Pn||Jd(t,n,V,a,$,Y,C)||e!==null&&e.dependencies!==null&&ds(e.dependencies))?(H||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(a,Y,C),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(a,Y,C)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||f===e.memoizedProps&&$===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&$===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=Y),r.props=a,r.state=Y,r.context=C,a=V):(typeof r.componentDidUpdate!="function"||f===e.memoizedProps&&$===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&$===e.memoizedState||(t.flags|=1024),a=!1)}return r=a,_s(e,t),a=(t.flags&128)!==0,r||a?(r=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&a?(t.child=Ua(t,e.child,null,s),t.child=Ua(t,null,n,s)):ft(e,t,n,s),t.memoizedState=r.state,e=t.child):e=Nn(e,t,s),e}function pf(e,t,n,a){return _a(),t.flags|=256,ft(e,t,n,a),t.child}var Ro={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Oo(e){return{baseLanes:e,cachePool:nd()}}function No(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Ht),e}function vf(e,t,n){var a=t.pendingProps,s=!1,r=(t.flags&128)!==0,f;if((f=r)||(f=e!==null&&e.memoizedState===null?!1:(tt.current&2)!==0),f&&(s=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(De){if(s?na(t):aa(),(e=Xe)?(e=kh(e,Kt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zn!==null?{id:un,overflow:dn}:null,retryLane:536870912,hydrationErrors:null},n=Qu(e),n.return=t,t.child=n,ut=t,Xe=null)):e=null,e===null)throw Jn(t);return gc(e)?t.lanes=32:t.lanes=536870912,null}var v=a.children;return a=a.fallback,s?(aa(),s=t.mode,v=Ds({mode:"hidden",children:v},s),a=Ea(a,s,n,null),v.return=t,a.return=t,v.sibling=a,t.child=v,a=t.child,a.memoizedState=Oo(n),a.childLanes=No(e,f,n),t.memoizedState=Ro,pi(null,a)):(na(t),Uo(t,v))}var C=e.memoizedState;if(C!==null&&(v=C.dehydrated,v!==null)){if(r)t.flags&256?(na(t),t.flags&=-257,t=Ho(e,t,n)):t.memoizedState!==null?(aa(),t.child=e.child,t.flags|=128,t=null):(aa(),v=a.fallback,s=t.mode,a=Ds({mode:"visible",children:a.children},s),v=Ea(v,s,n,null),v.flags|=2,a.return=t,v.return=t,a.sibling=v,t.child=a,Ua(t,e.child,null,n),a=t.child,a.memoizedState=Oo(n),a.childLanes=No(e,f,n),t.memoizedState=Ro,t=pi(null,a));else if(na(t),gc(v)){if(f=v.nextSibling&&v.nextSibling.dataset,f)var H=f.dgst;f=H,a=Error(o(419)),a.stack="",a.digest=f,ni({value:a,source:null,stack:null}),t=Ho(e,t,n)}else if(st||dl(e,t,n,!1),f=(n&e.childLanes)!==0,st||f){if(f=We,f!==null&&(a=Za(f,n),a!==0&&a!==C.retryLane))throw C.retryLane=a,Ma(e,a),Dt(f,e,a),Do;mc(v)||qs(),t=Ho(e,t,n)}else mc(v)?(t.flags|=192,t.child=e.child,t=null):(e=C.treeContext,Xe=Ft(v.nextSibling),ut=t,De=!0,Fn=null,Kt=!1,e!==null&&Fu(t,e),t=Uo(t,a.children),t.flags|=4096);return t}return s?(aa(),v=a.fallback,s=t.mode,C=e.child,H=C.sibling,a=En(C,{mode:"hidden",children:a.children}),a.subtreeFlags=C.subtreeFlags&65011712,H!==null?v=En(H,v):(v=Ea(v,s,n,null),v.flags|=2),v.return=t,a.return=t,a.sibling=v,t.child=a,pi(null,a),a=t.child,v=e.child.memoizedState,v===null?v=Oo(n):(s=v.cachePool,s!==null?(C=lt._currentValue,s=s.parent!==C?{parent:C,pool:C}:s):s=nd(),v={baseLanes:v.baseLanes|n,cachePool:s}),a.memoizedState=v,a.childLanes=No(e,f,n),t.memoizedState=Ro,pi(e.child,a)):(na(t),n=e.child,e=n.sibling,n=En(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=n,t.memoizedState=null,n)}function Uo(e,t){return t=Ds({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ds(e,t){return e=Rt(22,e,null,t),e.lanes=0,e}function Ho(e,t,n){return Ua(t,e.child,null,n),e=Uo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function mf(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Jr(e.return,t,n)}function Bo(e,t,n,a,s,r){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:s,treeForkCount:r}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=a,f.tail=n,f.tailMode=s,f.treeForkCount=r)}function gf(e,t,n){var a=t.pendingProps,s=a.revealOrder,r=a.tail;a=a.children;var f=tt.current,v=(f&2)!==0;if(v?(f=f&1|2,t.flags|=128):f&=1,A(tt,f),ft(e,t,a,n),a=De?ti:0,!v&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&mf(e,n,t);else if(e.tag===19)mf(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&xs(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Bo(t,!1,s,n,r,a);break;case"backwards":case"unstable_legacy-backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&xs(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Bo(t,!0,n,null,r,a);break;case"together":Bo(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Nn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),sa|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(dl(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=En(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=En(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function $o(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ds(e)))}function bm(e,t,n){switch(t.tag){case 3:Ue(t,t.stateNode.containerInfo),In(t,lt,e.memoizedState.cache),_a();break;case 27:case 5:W(t);break;case 4:Ue(t,t.stateNode.containerInfo);break;case 10:In(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,co(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(na(t),t.flags|=128,null):(n&t.child.childLanes)!==0?vf(e,t,n):(na(t),e=Nn(e,t,n),e!==null?e.sibling:null);na(t);break;case 19:var s=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(dl(e,t,n,!1),a=(n&t.childLanes)!==0),s){if(a)return gf(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),A(tt,tt.current),a)break;return null;case 22:return t.lanes=0,cf(e,t,n,t.pendingProps);case 24:In(t,lt,e.memoizedState.cache)}return Nn(e,t,n)}function yf(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)st=!0;else{if(!$o(e,n)&&(t.flags&128)===0)return st=!1,bm(e,t,n);st=(e.flags&131072)!==0}else st=!1,De&&(t.flags&1048576)!==0&&Zu(t,ti,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Oa(t.elementType),t.type=e,typeof e=="function")Gr(e)?(a=Ba(e,a),t.tag=1,t=hf(null,t,e,a,n)):(t.tag=0,t=Ao(null,t,e,a,n));else{if(e!=null){var s=e.$$typeof;if(s===Z){t.tag=11,t=sf(null,t,e,a,n);break e}else if(s===L){t.tag=14,t=rf(null,t,e,a,n);break e}}throw t=se(e)||e,Error(o(306,t,""))}}return t;case 0:return Ao(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,s=Ba(a,t.pendingProps),hf(e,t,a,s,n);case 3:e:{if(Ue(t,t.stateNode.containerInfo),e===null)throw Error(o(387));a=t.pendingProps;var r=t.memoizedState;s=r.element,lo(e,t),ci(t,a,null,n);var f=t.memoizedState;if(a=f.cache,In(t,lt,a),a!==r.cache&&Ir(t,[lt],n,!0),oi(),a=f.element,r.isDehydrated)if(r={element:a,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=pf(e,t,a,n);break e}else if(a!==s){s=Xt(Error(o(424)),t),ni(s),t=pf(e,t,a,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Xe=Ft(e.firstChild),ut=t,De=!0,Fn=null,Kt=!0,n=od(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(_a(),a===s){t=Nn(e,t,n);break e}ft(e,t,a,n)}t=t.child}return t;case 26:return _s(e,t),e===null?(n=Eh(t.type,null,t.pendingProps,null))?t.memoizedState=n:De||(n=t.type,e=t.pendingProps,a=Qs(oe.current).createElement(n),a[Je]=t,a[gt]=e,ht(a,n,e),at(a),t.stateNode=a):t.memoizedState=Eh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return W(t),e===null&&De&&(a=t.stateNode=Ch(t.type,t.pendingProps,oe.current),ut=t,Kt=!0,s=Xe,da(t.type)?(yc=s,Xe=Ft(a.firstChild)):Xe=s),ft(e,t,t.pendingProps.children,n),_s(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&De&&((s=a=Xe)&&(a=Fm(a,t.type,t.pendingProps,Kt),a!==null?(t.stateNode=a,ut=t,Xe=Ft(a.firstChild),Kt=!1,s=!0):s=!1),s||Jn(t)),W(t),s=t.type,r=t.pendingProps,f=e!==null?e.memoizedProps:null,a=r.children,hc(s,r)?a=null:f!==null&&hc(s,f)&&(t.flags|=32),t.memoizedState!==null&&(s=fo(e,t,dm,null,null,n),Ei._currentValue=s),_s(e,t),ft(e,t,a,n),t.child;case 6:return e===null&&De&&((e=n=Xe)&&(n=Jm(n,t.pendingProps,Kt),n!==null?(t.stateNode=n,ut=t,Xe=null,e=!0):e=!1),e||Jn(t)),null;case 13:return vf(e,t,n);case 4:return Ue(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Ua(t,null,a,n):ft(e,t,a,n),t.child;case 11:return sf(e,t,t.type,t.pendingProps,n);case 7:return ft(e,t,t.pendingProps,n),t.child;case 8:return ft(e,t,t.pendingProps.children,n),t.child;case 12:return ft(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,In(t,t.type,a.value),ft(e,t,a.children,n),t.child;case 9:return s=t.type._context,a=t.pendingProps.children,Aa(t),s=dt(s),a=a(s),t.flags|=1,ft(e,t,a,n),t.child;case 14:return rf(e,t,t.type,t.pendingProps,n);case 15:return of(e,t,t.type,t.pendingProps,n);case 19:return gf(e,t,n);case 31:return xm(e,t,n);case 22:return cf(e,t,n,t.pendingProps);case 24:return Aa(t),a=dt(lt),e===null?(s=to(),s===null&&(s=We,r=Pr(),s.pooledCache=r,r.refCount++,r!==null&&(s.pooledCacheLanes|=n),s=r),t.memoizedState={parent:a,cache:s},ao(t),In(t,lt,s)):((e.lanes&n)!==0&&(lo(e,t),ci(t,null,null,n),oi()),s=e.memoizedState,r=t.memoizedState,s.parent!==a?(s={parent:a,cache:a},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),In(t,lt,a)):(a=r.cache,In(t,lt,a),a!==s.cache&&Ir(t,[lt],n,!0))),ft(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Un(e){e.flags|=4}function qo(e,t,n,a,s){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(Xf())e.flags|=8192;else throw Na=vs,no}else e.flags&=-16777217}function xf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Oh(t))if(Xf())e.flags|=8192;else throw Na=vs,no}function As(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Wi():536870912,e.lanes|=t,kl|=t)}function vi(e,t){if(!De)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Ve(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,a|=s.subtreeFlags&65011712,a|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,a|=s.subtreeFlags,a|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function jm(e,t,n){var a=t.pendingProps;switch(Qr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ve(t),null;case 1:return Ve(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),An(lt),ge(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ul(t)?Un(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Zr())),Ve(t),null;case 26:var s=t.type,r=t.memoizedState;return e===null?(Un(t),r!==null?(Ve(t),xf(t,r)):(Ve(t),qo(t,s,null,a,n))):r?r!==e.memoizedState?(Un(t),Ve(t),xf(t,r)):(Ve(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&Un(t),Ve(t),qo(t,s,e,a,n)),null;case 27:if(ze(t),n=oe.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Un(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Ve(t),null}e=F.current,ul(t)?Ju(t):(e=Ch(s,a,n),t.stateNode=e,Un(t))}return Ve(t),null;case 5:if(ze(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Un(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Ve(t),null}if(r=F.current,ul(t))Ju(t);else{var f=Qs(oe.current);switch(r){case 1:r=f.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:r=f.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":r=f.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":r=f.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":r=f.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof a.is=="string"?f.createElement("select",{is:a.is}):f.createElement("select"),a.multiple?r.multiple=!0:a.size&&(r.size=a.size);break;default:r=typeof a.is=="string"?f.createElement(s,{is:a.is}):f.createElement(s)}}r[Je]=t,r[gt]=a;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)r.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=r;e:switch(ht(r,s,a),s){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Un(t)}}return Ve(t),qo(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Un(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(o(166));if(e=oe.current,ul(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,s=ut,s!==null)switch(s.tag){case 27:case 5:a=s.memoizedProps}e[Je]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||vh(e.nodeValue,n)),e||Jn(t,!0)}else e=Qs(e).createTextNode(a),e[Je]=t,t.stateNode=e}return Ve(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=ul(t),n!==null){if(e===null){if(!a)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Je]=t}else _a(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ve(t),e=!1}else n=Zr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Nt(t),t):(Nt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Ve(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=ul(t),a!==null&&a.dehydrated!==null){if(e===null){if(!s)throw Error(o(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));s[Je]=t}else _a(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ve(t),s=!1}else s=Zr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(Nt(t),t):(Nt(t),null)}return Nt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,s=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(s=a.alternate.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==s&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),As(t,t.updateQueue),Ve(t),null);case 4:return ge(),e===null&&oc(t.stateNode.containerInfo),Ve(t),null;case 10:return An(t.type),Ve(t),null;case 19:if(Q(tt),a=t.memoizedState,a===null)return Ve(t),null;if(s=(t.flags&128)!==0,r=a.rendering,r===null)if(s)vi(a,!1);else{if(Pe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=xs(e),r!==null){for(t.flags|=128,vi(a,!1),e=r.updateQueue,t.updateQueue=e,As(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Vu(n,e),n=n.sibling;return A(tt,tt.current&1|2),De&&_n(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&bt()>Hs&&(t.flags|=128,s=!0,vi(a,!1),t.lanes=4194304)}else{if(!s)if(e=xs(r),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,As(t,e),vi(a,!0),a.tail===null&&a.tailMode==="hidden"&&!r.alternate&&!De)return Ve(t),null}else 2*bt()-a.renderingStartTime>Hs&&n!==536870912&&(t.flags|=128,s=!0,vi(a,!1),t.lanes=4194304);a.isBackwards?(r.sibling=t.child,t.child=r):(e=a.last,e!==null?e.sibling=r:t.child=r,a.last=r)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=bt(),e.sibling=null,n=tt.current,A(tt,s?n&1|2:n&1),De&&_n(t,a.treeForkCount),e):(Ve(t),null);case 22:case 23:return Nt(t),oo(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Ve(t),t.subtreeFlags&6&&(t.flags|=8192)):Ve(t),n=t.updateQueue,n!==null&&As(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&Q(Ra),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),An(lt),Ve(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Sm(e,t){switch(Qr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return An(lt),ge(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ze(t),null;case 31:if(t.memoizedState!==null){if(Nt(t),t.alternate===null)throw Error(o(340));_a()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Nt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));_a()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Q(tt),null;case 4:return ge(),null;case 10:return An(t.type),null;case 22:case 23:return Nt(t),oo(),e!==null&&Q(Ra),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return An(lt),null;case 25:return null;default:return null}}function bf(e,t){switch(Qr(t),t.tag){case 3:An(lt),ge();break;case 26:case 27:case 5:ze(t);break;case 4:ge();break;case 31:t.memoizedState!==null&&Nt(t);break;case 13:Nt(t);break;case 19:Q(tt);break;case 10:An(t.type);break;case 22:case 23:Nt(t),oo(),e!==null&&Q(Ra);break;case 24:An(lt)}}function mi(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var s=a.next;n=s;do{if((n.tag&e)===e){a=void 0;var r=n.create,f=n.inst;a=r(),f.destroy=a}n=n.next}while(n!==s)}}catch(v){qe(t,t.return,v)}}function la(e,t,n){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var r=s.next;a=r;do{if((a.tag&e)===e){var f=a.inst,v=f.destroy;if(v!==void 0){f.destroy=void 0,s=t;var C=n,H=v;try{H()}catch(V){qe(s,C,V)}}}a=a.next}while(a!==r)}}catch(V){qe(t,t.return,V)}}function jf(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ud(t,n)}catch(a){qe(e,e.return,a)}}}function Sf(e,t,n){n.props=Ba(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){qe(e,t,a)}}function gi(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(s){qe(e,t,s)}}function fn(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(s){qe(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(s){qe(e,t,s)}else n.current=null}function kf(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(s){qe(e,e.return,s)}}function Lo(e,t,n){try{var a=e.stateNode;Wm(a,e.type,n,t),a[gt]=t}catch(s){qe(e,e.return,s)}}function wf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&da(e.type)||e.tag===4}function Yo(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||wf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&da(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Go(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Tn));else if(a!==4&&(a===27&&da(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Go(e,t,n),e=e.sibling;e!==null;)Go(e,t,n),e=e.sibling}function Rs(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&da(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Rs(e,t,n),e=e.sibling;e!==null;)Rs(e,t,n),e=e.sibling}function zf(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);ht(t,a,n),t[Je]=e,t[gt]=n}catch(r){qe(e,e.return,r)}}var Hn=!1,rt=!1,Wo=!1,Cf=typeof WeakSet=="function"?WeakSet:Set,ct=null;function km(e,t){if(e=e.containerInfo,dc=er,e=Hu(e),Ur(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var s=a.anchorOffset,r=a.focusNode;a=a.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break e}var f=0,v=-1,C=-1,H=0,V=0,J=e,$=null;t:for(;;){for(var Y;J!==n||s!==0&&J.nodeType!==3||(v=f+s),J!==r||a!==0&&J.nodeType!==3||(C=f+a),J.nodeType===3&&(f+=J.nodeValue.length),(Y=J.firstChild)!==null;)$=J,J=Y;for(;;){if(J===e)break t;if($===n&&++H===s&&(v=f),$===r&&++V===a&&(C=f),(Y=J.nextSibling)!==null)break;J=$,$=J.parentNode}J=Y}n=v===-1||C===-1?null:{start:v,end:C}}else n=null}n=n||{start:0,end:0}}else n=null;for(fc={focusedElem:e,selectionRange:n},er=!1,ct=t;ct!==null;)if(t=ct,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ct=e;else for(;ct!==null;){switch(t=ct,r=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)s=e[n],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&r!==null){e=void 0,n=t,s=r.memoizedProps,r=r.memoizedState,a=n.stateNode;try{var fe=Ba(n.type,s);e=a.getSnapshotBeforeUpdate(fe,r),a.__reactInternalSnapshotBeforeUpdate=e}catch(ye){qe(n,n.return,ye)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)vc(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":vc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,ct=e;break}ct=t.return}}function Tf(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:$n(e,n),a&4&&mi(5,n);break;case 1:if($n(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(f){qe(n,n.return,f)}else{var s=Ba(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){qe(n,n.return,f)}}a&64&&jf(n),a&512&&gi(n,n.return);break;case 3:if($n(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{ud(e,t)}catch(f){qe(n,n.return,f)}}break;case 27:t===null&&a&4&&zf(n);case 26:case 5:$n(e,n),t===null&&a&4&&kf(n),a&512&&gi(n,n.return);break;case 12:$n(e,n);break;case 31:$n(e,n),a&4&&_f(e,n);break;case 13:$n(e,n),a&4&&Df(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Am.bind(null,n),Im(e,n))));break;case 22:if(a=n.memoizedState!==null||Hn,!a){t=t!==null&&t.memoizedState!==null||rt,s=Hn;var r=rt;Hn=a,(rt=t)&&!r?qn(e,n,(n.subtreeFlags&8772)!==0):$n(e,n),Hn=s,rt=r}break;case 30:break;default:$n(e,n)}}function Mf(e){var t=e.alternate;t!==null&&(e.alternate=null,Mf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ia(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ze=null,Tt=!1;function Bn(e,t,n){for(n=n.child;n!==null;)Ef(e,t,n),n=n.sibling}function Ef(e,t,n){if(mt&&typeof mt.onCommitFiberUnmount=="function")try{mt.onCommitFiberUnmount(ba,n)}catch{}switch(n.tag){case 26:rt||fn(n,t),Bn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:rt||fn(n,t);var a=Ze,s=Tt;da(n.type)&&(Ze=n.stateNode,Tt=!1),Bn(e,t,n),Ci(n.stateNode),Ze=a,Tt=s;break;case 5:rt||fn(n,t);case 6:if(a=Ze,s=Tt,Ze=null,Bn(e,t,n),Ze=a,Tt=s,Ze!==null)if(Tt)try{(Ze.nodeType===9?Ze.body:Ze.nodeName==="HTML"?Ze.ownerDocument.body:Ze).removeChild(n.stateNode)}catch(r){qe(n,t,r)}else try{Ze.removeChild(n.stateNode)}catch(r){qe(n,t,r)}break;case 18:Ze!==null&&(Tt?(e=Ze,jh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Dl(e)):jh(Ze,n.stateNode));break;case 4:a=Ze,s=Tt,Ze=n.stateNode.containerInfo,Tt=!0,Bn(e,t,n),Ze=a,Tt=s;break;case 0:case 11:case 14:case 15:la(2,n,t),rt||la(4,n,t),Bn(e,t,n);break;case 1:rt||(fn(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Sf(n,t,a)),Bn(e,t,n);break;case 21:Bn(e,t,n);break;case 22:rt=(a=rt)||n.memoizedState!==null,Bn(e,t,n),rt=a;break;default:Bn(e,t,n)}}function _f(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Dl(e)}catch(n){qe(t,t.return,n)}}}function Df(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Dl(e)}catch(n){qe(t,t.return,n)}}function wm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Cf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Cf),t;default:throw Error(o(435,e.tag))}}function Os(e,t){var n=wm(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var s=Rm.bind(null,e,a);a.then(s,s)}})}function Mt(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var s=n[a],r=e,f=t,v=f;e:for(;v!==null;){switch(v.tag){case 27:if(da(v.type)){Ze=v.stateNode,Tt=!1;break e}break;case 5:Ze=v.stateNode,Tt=!1;break e;case 3:case 4:Ze=v.stateNode.containerInfo,Tt=!0;break e}v=v.return}if(Ze===null)throw Error(o(160));Ef(r,f,s),Ze=null,Tt=!1,r=s.alternate,r!==null&&(r.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Af(t,e),t=t.sibling}var an=null;function Af(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Mt(t,e),Et(e),a&4&&(la(3,e,e.return),mi(3,e),la(5,e,e.return));break;case 1:Mt(t,e),Et(e),a&512&&(rt||n===null||fn(n,n.return)),a&64&&Hn&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var s=an;if(Mt(t,e),Et(e),a&512&&(rt||n===null||fn(n,n.return)),a&4){var r=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,s=s.ownerDocument||s;t:switch(a){case"title":r=s.getElementsByTagName("title")[0],(!r||r[Sn]||r[Je]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=s.createElement(a),s.head.insertBefore(r,s.querySelector("head > title"))),ht(r,a,n),r[Je]=e,at(r),a=r;break e;case"link":var f=Ah("link","href",s).get(a+(n.href||""));if(f){for(var v=0;v<f.length;v++)if(r=f[v],r.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&r.getAttribute("rel")===(n.rel==null?null:n.rel)&&r.getAttribute("title")===(n.title==null?null:n.title)&&r.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){f.splice(v,1);break t}}r=s.createElement(a),ht(r,a,n),s.head.appendChild(r);break;case"meta":if(f=Ah("meta","content",s).get(a+(n.content||""))){for(v=0;v<f.length;v++)if(r=f[v],r.getAttribute("content")===(n.content==null?null:""+n.content)&&r.getAttribute("name")===(n.name==null?null:n.name)&&r.getAttribute("property")===(n.property==null?null:n.property)&&r.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute("charset")===(n.charSet==null?null:n.charSet)){f.splice(v,1);break t}}r=s.createElement(a),ht(r,a,n),s.head.appendChild(r);break;default:throw Error(o(468,a))}r[Je]=e,at(r),a=r}e.stateNode=a}else Rh(s,e.type,e.stateNode);else e.stateNode=Dh(s,a,e.memoizedProps);else r!==a?(r===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):r.count--,a===null?Rh(s,e.type,e.stateNode):Dh(s,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Lo(e,e.memoizedProps,n.memoizedProps)}break;case 27:Mt(t,e),Et(e),a&512&&(rt||n===null||fn(n,n.return)),n!==null&&a&4&&Lo(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Mt(t,e),Et(e),a&512&&(rt||n===null||fn(n,n.return)),e.flags&32){s=e.stateNode;try{el(s,"")}catch(fe){qe(e,e.return,fe)}}a&4&&e.stateNode!=null&&(s=e.memoizedProps,Lo(e,s,n!==null?n.memoizedProps:s)),a&1024&&(Wo=!0);break;case 6:if(Mt(t,e),Et(e),a&4){if(e.stateNode===null)throw Error(o(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(fe){qe(e,e.return,fe)}}break;case 3:if(Fs=null,s=an,an=Ks(t.containerInfo),Mt(t,e),an=s,Et(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{Dl(t.containerInfo)}catch(fe){qe(e,e.return,fe)}Wo&&(Wo=!1,Rf(e));break;case 4:a=an,an=Ks(e.stateNode.containerInfo),Mt(t,e),Et(e),an=a;break;case 12:Mt(t,e),Et(e);break;case 31:Mt(t,e),Et(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Os(e,a)));break;case 13:Mt(t,e),Et(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Us=bt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Os(e,a)));break;case 22:s=e.memoizedState!==null;var C=n!==null&&n.memoizedState!==null,H=Hn,V=rt;if(Hn=H||s,rt=V||C,Mt(t,e),rt=V,Hn=H,Et(e),a&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(n===null||C||Hn||rt||$a(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){C=n=t;try{if(r=C.stateNode,s)f=r.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{v=C.stateNode;var J=C.memoizedProps.style,$=J!=null&&J.hasOwnProperty("display")?J.display:null;v.style.display=$==null||typeof $=="boolean"?"":(""+$).trim()}}catch(fe){qe(C,C.return,fe)}}}else if(t.tag===6){if(n===null){C=t;try{C.stateNode.nodeValue=s?"":C.memoizedProps}catch(fe){qe(C,C.return,fe)}}}else if(t.tag===18){if(n===null){C=t;try{var Y=C.stateNode;s?Sh(Y,!0):Sh(C.stateNode,!1)}catch(fe){qe(C,C.return,fe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,Os(e,n))));break;case 19:Mt(t,e),Et(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Os(e,a)));break;case 30:break;case 21:break;default:Mt(t,e),Et(e)}}function Et(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(wf(a)){n=a;break}a=a.return}if(n==null)throw Error(o(160));switch(n.tag){case 27:var s=n.stateNode,r=Yo(e);Rs(e,r,s);break;case 5:var f=n.stateNode;n.flags&32&&(el(f,""),n.flags&=-33);var v=Yo(e);Rs(e,v,f);break;case 3:case 4:var C=n.stateNode.containerInfo,H=Yo(e);Go(e,H,C);break;default:throw Error(o(161))}}catch(V){qe(e,e.return,V)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Rf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Rf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function $n(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Tf(e,t.alternate,t),t=t.sibling}function $a(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:la(4,t,t.return),$a(t);break;case 1:fn(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Sf(t,t.return,n),$a(t);break;case 27:Ci(t.stateNode);case 26:case 5:fn(t,t.return),$a(t);break;case 22:t.memoizedState===null&&$a(t);break;case 30:$a(t);break;default:$a(t)}e=e.sibling}}function qn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,s=e,r=t,f=r.flags;switch(r.tag){case 0:case 11:case 15:qn(s,r,n),mi(4,r);break;case 1:if(qn(s,r,n),a=r,s=a.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(H){qe(a,a.return,H)}if(a=r,s=a.updateQueue,s!==null){var v=a.stateNode;try{var C=s.shared.hiddenCallbacks;if(C!==null)for(s.shared.hiddenCallbacks=null,s=0;s<C.length;s++)cd(C[s],v)}catch(H){qe(a,a.return,H)}}n&&f&64&&jf(r),gi(r,r.return);break;case 27:zf(r);case 26:case 5:qn(s,r,n),n&&a===null&&f&4&&kf(r),gi(r,r.return);break;case 12:qn(s,r,n);break;case 31:qn(s,r,n),n&&f&4&&_f(s,r);break;case 13:qn(s,r,n),n&&f&4&&Df(s,r);break;case 22:r.memoizedState===null&&qn(s,r,n),gi(r,r.return);break;case 30:break;default:qn(s,r,n)}t=t.sibling}}function Xo(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ai(n))}function Vo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ai(e))}function ln(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Of(e,t,n,a),t=t.sibling}function Of(e,t,n,a){var s=t.flags;switch(t.tag){case 0:case 11:case 15:ln(e,t,n,a),s&2048&&mi(9,t);break;case 1:ln(e,t,n,a);break;case 3:ln(e,t,n,a),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ai(e)));break;case 12:if(s&2048){ln(e,t,n,a),e=t.stateNode;try{var r=t.memoizedProps,f=r.id,v=r.onPostCommit;typeof v=="function"&&v(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(C){qe(t,t.return,C)}}else ln(e,t,n,a);break;case 31:ln(e,t,n,a);break;case 13:ln(e,t,n,a);break;case 23:break;case 22:r=t.stateNode,f=t.alternate,t.memoizedState!==null?r._visibility&2?ln(e,t,n,a):yi(e,t):r._visibility&2?ln(e,t,n,a):(r._visibility|=2,bl(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),s&2048&&Xo(f,t);break;case 24:ln(e,t,n,a),s&2048&&Vo(t.alternate,t);break;default:ln(e,t,n,a)}}function bl(e,t,n,a,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,f=t,v=n,C=a,H=f.flags;switch(f.tag){case 0:case 11:case 15:bl(r,f,v,C,s),mi(8,f);break;case 23:break;case 22:var V=f.stateNode;f.memoizedState!==null?V._visibility&2?bl(r,f,v,C,s):yi(r,f):(V._visibility|=2,bl(r,f,v,C,s)),s&&H&2048&&Xo(f.alternate,f);break;case 24:bl(r,f,v,C,s),s&&H&2048&&Vo(f.alternate,f);break;default:bl(r,f,v,C,s)}t=t.sibling}}function yi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,s=a.flags;switch(a.tag){case 22:yi(n,a),s&2048&&Xo(a.alternate,a);break;case 24:yi(n,a),s&2048&&Vo(a.alternate,a);break;default:yi(n,a)}t=t.sibling}}var xi=8192;function jl(e,t,n){if(e.subtreeFlags&xi)for(e=e.child;e!==null;)Nf(e,t,n),e=e.sibling}function Nf(e,t,n){switch(e.tag){case 26:jl(e,t,n),e.flags&xi&&e.memoizedState!==null&&ug(n,an,e.memoizedState,e.memoizedProps);break;case 5:jl(e,t,n);break;case 3:case 4:var a=an;an=Ks(e.stateNode.containerInfo),jl(e,t,n),an=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=xi,xi=16777216,jl(e,t,n),xi=a):jl(e,t,n));break;default:jl(e,t,n)}}function Uf(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function bi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];ct=a,Bf(a,e)}Uf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Hf(e),e=e.sibling}function Hf(e){switch(e.tag){case 0:case 11:case 15:bi(e),e.flags&2048&&la(9,e,e.return);break;case 3:bi(e);break;case 12:bi(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ns(e)):bi(e);break;default:bi(e)}}function Ns(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];ct=a,Bf(a,e)}Uf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:la(8,t,t.return),Ns(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ns(t));break;default:Ns(t)}e=e.sibling}}function Bf(e,t){for(;ct!==null;){var n=ct;switch(n.tag){case 0:case 11:case 15:la(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:ai(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,ct=a;else e:for(n=e;ct!==null;){a=ct;var s=a.sibling,r=a.return;if(Mf(a),a===n){ct=null;break e}if(s!==null){s.return=r,ct=s;break e}ct=r}}}var zm={getCacheForType:function(e){var t=dt(lt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return dt(lt).controller.signal}},Cm=typeof WeakMap=="function"?WeakMap:Map,Ne=0,We=null,Te=null,Ee=0,$e=0,Ut=null,ia=!1,Sl=!1,Qo=!1,Ln=0,Pe=0,sa=0,qa=0,Ko=0,Ht=0,kl=0,ji=null,_t=null,Zo=!1,Us=0,$f=0,Hs=1/0,Bs=null,ra=null,ot=0,oa=null,wl=null,Yn=0,Fo=0,Jo=null,qf=null,Si=0,Io=null;function Bt(){return(Ne&2)!==0&&Ee!==0?Ee&-Ee:j.T!==null?lc():Xi()}function Lf(){if(Ht===0)if((Ee&536870912)===0||De){var e=Sa;Sa<<=1,(Sa&3932160)===0&&(Sa=262144),Ht=e}else Ht=536870912;return e=Ot.current,e!==null&&(e.flags|=32),Ht}function Dt(e,t,n){(e===We&&($e===2||$e===9)||e.cancelPendingCommit!==null)&&(zl(e,0),ca(e,Ee,Ht,!1)),xn(e,n),((Ne&2)===0||e!==We)&&(e===We&&((Ne&2)===0&&(qa|=n),Pe===4&&ca(e,Ee,Ht,!1)),hn(e))}function Yf(e,t,n){if((Ne&6)!==0)throw Error(o(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Xn(e,t),s=a?Em(e,t):ec(e,t,!0),r=a;do{if(s===0){Sl&&!a&&ca(e,t,0,!1);break}else{if(n=e.current.alternate,r&&!Tm(n)){s=ec(e,t,!1),r=!1;continue}if(s===2){if(r=t,e.errorRecoveryDisabledLanes&r)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var v=e;s=ji;var C=v.current.memoizedState.isDehydrated;if(C&&(zl(v,f).flags|=256),f=ec(v,f,!1),f!==2){if(Qo&&!C){v.errorRecoveryDisabledLanes|=r,qa|=r,s=4;break e}r=_t,_t=s,r!==null&&(_t===null?_t=r:_t.push.apply(_t,r))}s=f}if(r=!1,s!==2)continue}}if(s===1){zl(e,0),ca(e,t,0,!0);break}e:{switch(a=e,r=s,r){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:ca(a,t,Ht,!ia);break e;case 2:_t=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(s=Us+300-bt(),10<s)){if(ca(a,t,Ht,!ia),ka(a,0,!0)!==0)break e;Yn=t,a.timeoutHandle=xh(Gf.bind(null,a,n,_t,Bs,Zo,t,Ht,qa,kl,ia,r,"Throttled",-0,0),s);break e}Gf(a,n,_t,Bs,Zo,t,Ht,qa,kl,ia,r,null,-0,0)}}break}while(!0);hn(e)}function Gf(e,t,n,a,s,r,f,v,C,H,V,J,$,Y){if(e.timeoutHandle=-1,J=t.subtreeFlags,J&8192||(J&16785408)===16785408){J={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Tn},Nf(t,r,J);var fe=(r&62914560)===r?Us-bt():(r&4194048)===r?$f-bt():0;if(fe=dg(J,fe),fe!==null){Yn=r,e.cancelPendingCommit=fe(Jf.bind(null,e,t,r,n,a,s,f,v,C,V,J,null,$,Y)),ca(e,r,f,!H);return}}Jf(e,t,r,n,a,s,f,v,C)}function Tm(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var s=n[a],r=s.getSnapshot;s=s.value;try{if(!At(r(),s))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ca(e,t,n,a){t&=~Ko,t&=~qa,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var s=t;0<s;){var r=31-jt(s),f=1<<r;a[r]=-1,s&=~f}n!==0&&on(e,n,t)}function $s(){return(Ne&6)===0?(ki(0),!1):!0}function Po(){if(Te!==null){if($e===0)var e=Te.return;else e=Te,Dn=Da=null,vo(e),vl=null,ii=0,e=Te;for(;e!==null;)bf(e.alternate,e),e=e.return;Te=null}}function zl(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Qm(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Yn=0,Po(),We=e,Te=n=En(e.current,null),Ee=t,$e=0,Ut=null,ia=!1,Sl=Xn(e,t),Qo=!1,kl=Ht=Ko=qa=sa=Pe=0,_t=ji=null,Zo=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var s=31-jt(a),r=1<<s;t|=e[s],a&=~r}return Ln=t,ss(),n}function Wf(e,t){ke=null,j.H=hi,t===pl||t===ps?(t=id(),$e=3):t===no?(t=id(),$e=4):$e=t===Do?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ut=t,Te===null&&(Pe=1,Ms(e,Xt(t,e.current)))}function Xf(){var e=Ot.current;return e===null?!0:(Ee&4194048)===Ee?Zt===null:(Ee&62914560)===Ee||(Ee&536870912)!==0?e===Zt:!1}function Vf(){var e=j.H;return j.H=hi,e===null?hi:e}function Qf(){var e=j.A;return j.A=zm,e}function qs(){Pe=4,ia||(Ee&4194048)!==Ee&&Ot.current!==null||(Sl=!0),(sa&134217727)===0&&(qa&134217727)===0||We===null||ca(We,Ee,Ht,!1)}function ec(e,t,n){var a=Ne;Ne|=2;var s=Vf(),r=Qf();(We!==e||Ee!==t)&&(Bs=null,zl(e,t)),t=!1;var f=Pe;e:do try{if($e!==0&&Te!==null){var v=Te,C=Ut;switch($e){case 8:Po(),f=6;break e;case 3:case 2:case 9:case 6:Ot.current===null&&(t=!0);var H=$e;if($e=0,Ut=null,Cl(e,v,C,H),n&&Sl){f=0;break e}break;default:H=$e,$e=0,Ut=null,Cl(e,v,C,H)}}Mm(),f=Pe;break}catch(V){Wf(e,V)}while(!0);return t&&e.shellSuspendCounter++,Dn=Da=null,Ne=a,j.H=s,j.A=r,Te===null&&(We=null,Ee=0,ss()),f}function Mm(){for(;Te!==null;)Kf(Te)}function Em(e,t){var n=Ne;Ne|=2;var a=Vf(),s=Qf();We!==e||Ee!==t?(Bs=null,Hs=bt()+500,zl(e,t)):Sl=Xn(e,t);e:do try{if($e!==0&&Te!==null){t=Te;var r=Ut;t:switch($e){case 1:$e=0,Ut=null,Cl(e,t,r,1);break;case 2:case 9:if(ad(r)){$e=0,Ut=null,Zf(t);break}t=function(){$e!==2&&$e!==9||We!==e||($e=7),hn(e)},r.then(t,t);break e;case 3:$e=7;break e;case 4:$e=5;break e;case 7:ad(r)?($e=0,Ut=null,Zf(t)):($e=0,Ut=null,Cl(e,t,r,7));break;case 5:var f=null;switch(Te.tag){case 26:f=Te.memoizedState;case 5:case 27:var v=Te;if(f?Oh(f):v.stateNode.complete){$e=0,Ut=null;var C=v.sibling;if(C!==null)Te=C;else{var H=v.return;H!==null?(Te=H,Ls(H)):Te=null}break t}}$e=0,Ut=null,Cl(e,t,r,5);break;case 6:$e=0,Ut=null,Cl(e,t,r,6);break;case 8:Po(),Pe=6;break e;default:throw Error(o(462))}}_m();break}catch(V){Wf(e,V)}while(!0);return Dn=Da=null,j.H=a,j.A=s,Ne=n,Te!==null?0:(We=null,Ee=0,ss(),Pe)}function _m(){for(;Te!==null&&!yr();)Kf(Te)}function Kf(e){var t=yf(e.alternate,e,Ln);e.memoizedProps=e.pendingProps,t===null?Ls(e):Te=t}function Zf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=ff(n,t,t.pendingProps,t.type,void 0,Ee);break;case 11:t=ff(n,t,t.pendingProps,t.type.render,t.ref,Ee);break;case 5:vo(t);default:bf(n,t),t=Te=Vu(t,Ln),t=yf(n,t,Ln)}e.memoizedProps=e.pendingProps,t===null?Ls(e):Te=t}function Cl(e,t,n,a){Dn=Da=null,vo(t),vl=null,ii=0;var s=t.return;try{if(ym(e,s,t,n,Ee)){Pe=1,Ms(e,Xt(n,e.current)),Te=null;return}}catch(r){if(s!==null)throw Te=s,r;Pe=1,Ms(e,Xt(n,e.current)),Te=null;return}t.flags&32768?(De||a===1?e=!0:Sl||(Ee&536870912)!==0?e=!1:(ia=e=!0,(a===2||a===9||a===3||a===6)&&(a=Ot.current,a!==null&&a.tag===13&&(a.flags|=16384))),Ff(t,e)):Ls(t)}function Ls(e){var t=e;do{if((t.flags&32768)!==0){Ff(t,ia);return}e=t.return;var n=jm(t.alternate,t,Ln);if(n!==null){Te=n;return}if(t=t.sibling,t!==null){Te=t;return}Te=t=e}while(t!==null);Pe===0&&(Pe=5)}function Ff(e,t){do{var n=Sm(e.alternate,e);if(n!==null){n.flags&=32767,Te=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Te=e;return}Te=e=n}while(e!==null);Pe=6,Te=null}function Jf(e,t,n,a,s,r,f,v,C){e.cancelPendingCommit=null;do Ys();while(ot!==0);if((Ne&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(r=t.lanes|t.childLanes,r|=Lr,bn(e,n,r,f,v,C),e===We&&(Te=We=null,Ee=0),wl=t,oa=e,Yn=n,Fo=r,Jo=s,qf=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Om(Va,function(){return nh(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=j.T,j.T=null,s=q.p,q.p=2,f=Ne,Ne|=4;try{km(e,t,n)}finally{Ne=f,q.p=s,j.T=a}}ot=1,If(),Pf(),eh()}}function If(){if(ot===1){ot=0;var e=oa,t=wl,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=j.T,j.T=null;var a=q.p;q.p=2;var s=Ne;Ne|=4;try{Af(t,e);var r=fc,f=Hu(e.containerInfo),v=r.focusedElem,C=r.selectionRange;if(f!==v&&v&&v.ownerDocument&&Uu(v.ownerDocument.documentElement,v)){if(C!==null&&Ur(v)){var H=C.start,V=C.end;if(V===void 0&&(V=H),"selectionStart"in v)v.selectionStart=H,v.selectionEnd=Math.min(V,v.value.length);else{var J=v.ownerDocument||document,$=J&&J.defaultView||window;if($.getSelection){var Y=$.getSelection(),fe=v.textContent.length,ye=Math.min(C.start,fe),Ge=C.end===void 0?ye:Math.min(C.end,fe);!Y.extend&&ye>Ge&&(f=Ge,Ge=ye,ye=f);var D=Nu(v,ye),E=Nu(v,Ge);if(D&&E&&(Y.rangeCount!==1||Y.anchorNode!==D.node||Y.anchorOffset!==D.offset||Y.focusNode!==E.node||Y.focusOffset!==E.offset)){var U=J.createRange();U.setStart(D.node,D.offset),Y.removeAllRanges(),ye>Ge?(Y.addRange(U),Y.extend(E.node,E.offset)):(U.setEnd(E.node,E.offset),Y.addRange(U))}}}}for(J=[],Y=v;Y=Y.parentNode;)Y.nodeType===1&&J.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<J.length;v++){var K=J[v];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}er=!!dc,fc=dc=null}finally{Ne=s,q.p=a,j.T=n}}e.current=t,ot=2}}function Pf(){if(ot===2){ot=0;var e=oa,t=wl,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=j.T,j.T=null;var a=q.p;q.p=2;var s=Ne;Ne|=4;try{Tf(e,t.alternate,t)}finally{Ne=s,q.p=a,j.T=n}}ot=3}}function eh(){if(ot===4||ot===3){ot=0,qi();var e=oa,t=wl,n=Yn,a=qf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ot=5:(ot=0,wl=oa=null,th(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(ra=null),Fa(n),t=t.stateNode,mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(ba,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=j.T,s=q.p,q.p=2,j.T=null;try{for(var r=e.onRecoverableError,f=0;f<a.length;f++){var v=a[f];r(v.value,{componentStack:v.stack})}}finally{j.T=t,q.p=s}}(Yn&3)!==0&&Ys(),hn(e),s=e.pendingLanes,(n&261930)!==0&&(s&42)!==0?e===Io?Si++:(Si=0,Io=e):Si=0,ki(0)}}function th(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ai(t)))}function Ys(){return If(),Pf(),eh(),nh()}function nh(){if(ot!==5)return!1;var e=oa,t=Fo;Fo=0;var n=Fa(Yn),a=j.T,s=q.p;try{q.p=32>n?32:n,j.T=null,n=Jo,Jo=null;var r=oa,f=Yn;if(ot=0,wl=oa=null,Yn=0,(Ne&6)!==0)throw Error(o(331));var v=Ne;if(Ne|=4,Hf(r.current),Of(r,r.current,f,n),Ne=v,ki(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(ba,r)}catch{}return!0}finally{q.p=s,j.T=a,th(e,t)}}function ah(e,t,n){t=Xt(n,t),t=_o(e.stateNode,t,2),e=ta(e,t,2),e!==null&&(xn(e,2),hn(e))}function qe(e,t,n){if(e.tag===3)ah(e,e,n);else for(;t!==null;){if(t.tag===3){ah(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(ra===null||!ra.has(a))){e=Xt(n,e),n=af(2),a=ta(t,n,2),a!==null&&(lf(n,a,t,e),xn(a,2),hn(a));break}}t=t.return}}function tc(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new Cm;var s=new Set;a.set(t,s)}else s=a.get(t),s===void 0&&(s=new Set,a.set(t,s));s.has(n)||(Qo=!0,s.add(n),e=Dm.bind(null,e,t,n),t.then(e,e))}function Dm(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,We===e&&(Ee&n)===n&&(Pe===4||Pe===3&&(Ee&62914560)===Ee&&300>bt()-Us?(Ne&2)===0&&zl(e,0):Ko|=n,kl===Ee&&(kl=0)),hn(e)}function lh(e,t){t===0&&(t=Wi()),e=Ma(e,t),e!==null&&(xn(e,t),hn(e))}function Am(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),lh(e,n)}function Rm(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(o(314))}a!==null&&a.delete(t),lh(e,n)}function Om(e,t){return Bl(e,t)}var Gs=null,Tl=null,nc=!1,Ws=!1,ac=!1,ua=0;function hn(e){e!==Tl&&e.next===null&&(Tl===null?Gs=Tl=e:Tl=Tl.next=e),Ws=!0,nc||(nc=!0,Um())}function ki(e,t){if(!ac&&Ws){ac=!0;do for(var n=!1,a=Gs;a!==null;){if(e!==0){var s=a.pendingLanes;if(s===0)var r=0;else{var f=a.suspendedLanes,v=a.pingedLanes;r=(1<<31-jt(42|e)+1)-1,r&=s&~(f&~v),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(n=!0,oh(a,r))}else r=Ee,r=ka(a,a===We?r:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(r&3)===0||Xn(a,r)||(n=!0,oh(a,r));a=a.next}while(n);ac=!1}}function Nm(){ih()}function ih(){Ws=nc=!1;var e=0;ua!==0&&Vm()&&(e=ua);for(var t=bt(),n=null,a=Gs;a!==null;){var s=a.next,r=sh(a,t);r===0?(a.next=null,n===null?Gs=s:n.next=s,s===null&&(Tl=n)):(n=a,(e!==0||(r&3)!==0)&&(Ws=!0)),a=s}ot!==0&&ot!==5||ki(e),ua!==0&&(ua=0)}function sh(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,s=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var f=31-jt(r),v=1<<f,C=s[f];C===-1?((v&n)===0||(v&a)!==0)&&(s[f]=Yl(v,t)):C<=t&&(e.expiredLanes|=v),r&=~v}if(t=We,n=Ee,n=ka(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&($e===2||$e===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Wa(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Xn(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&Wa(a),Fa(n)){case 2:case 8:n=ql;break;case 32:n=Va;break;case 268435456:n=xa;break;default:n=Va}return a=rh.bind(null,e),n=Bl(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&Wa(a),e.callbackPriority=2,e.callbackNode=null,2}function rh(e,t){if(ot!==0&&ot!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ys()&&e.callbackNode!==n)return null;var a=Ee;return a=ka(e,e===We?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Yf(e,a,t),sh(e,bt()),e.callbackNode!=null&&e.callbackNode===n?rh.bind(null,e):null)}function oh(e,t){if(Ys())return null;Yf(e,t,!0)}function Um(){Km(function(){(Ne&6)!==0?Bl($l,Nm):ih()})}function lc(){if(ua===0){var e=fl;e===0&&(e=ja,ja<<=1,(ja&261888)===0&&(ja=256)),ua=e}return ua}function ch(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ii(""+e)}function uh(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Hm(e,t,n,a,s){if(t==="submit"&&n&&n.stateNode===s){var r=ch((s[gt]||null).action),f=a.submitter;f&&(t=(t=f[gt]||null)?ch(t.formAction):f.getAttribute("formAction"),t!==null&&(r=t,f=null));var v=new ns("action","action",null,a,s);e.push({event:v,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(ua!==0){var C=f?uh(s,f):new FormData(s);wo(n,{pending:!0,data:C,method:s.method,action:r},null,C)}}else typeof r=="function"&&(v.preventDefault(),C=f?uh(s,f):new FormData(s),wo(n,{pending:!0,data:C,method:s.method,action:r},r,C))},currentTarget:s}]})}}for(var ic=0;ic<qr.length;ic++){var sc=qr[ic],Bm=sc.toLowerCase(),$m=sc[0].toUpperCase()+sc.slice(1);nn(Bm,"on"+$m)}nn(qu,"onAnimationEnd"),nn(Lu,"onAnimationIteration"),nn(Yu,"onAnimationStart"),nn("dblclick","onDoubleClick"),nn("focusin","onFocus"),nn("focusout","onBlur"),nn(tm,"onTransitionRun"),nn(nm,"onTransitionStart"),nn(am,"onTransitionCancel"),nn(Gu,"onTransitionEnd"),Ce("onMouseEnter",["mouseout","mouseover"]),Ce("onMouseLeave",["mouseout","mouseover"]),Ce("onPointerEnter",["pointerout","pointerover"]),Ce("onPointerLeave",["pointerout","pointerover"]),I("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),I("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),I("onBeforeInput",["compositionend","keypress","textInput","paste"]),I("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),I("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),I("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wi="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(" "),qm=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wi));function dh(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],s=a.event;a=a.listeners;e:{var r=void 0;if(t)for(var f=a.length-1;0<=f;f--){var v=a[f],C=v.instance,H=v.currentTarget;if(v=v.listener,C!==r&&s.isPropagationStopped())break e;r=v,s.currentTarget=H;try{r(s)}catch(V){is(V)}s.currentTarget=null,r=C}else for(f=0;f<a.length;f++){if(v=a[f],C=v.instance,H=v.currentTarget,v=v.listener,C!==r&&s.isPropagationStopped())break e;r=v,s.currentTarget=H;try{r(s)}catch(V){is(V)}s.currentTarget=null,r=C}}}}function Me(e,t){var n=t[Gl];n===void 0&&(n=t[Gl]=new Set);var a=e+"__bubble";n.has(a)||(fh(t,e,2,!1),n.add(a))}function rc(e,t,n){var a=0;t&&(a|=4),fh(n,e,a,t)}var Xs="_reactListening"+Math.random().toString(36).slice(2);function oc(e){if(!e[Xs]){e[Xs]=!0,Ki.forEach(function(n){n!=="selectionchange"&&(qm.has(n)||rc(n,!1,e),rc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xs]||(t[Xs]=!0,rc("selectionchange",!1,t))}}function fh(e,t,n,a){switch(Lh(t)){case 2:var s=pg;break;case 8:s=vg;break;default:s=kc}n=s.bind(null,t,n,e),s=void 0,!Tr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),a?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function cc(e,t,n,a,s){var r=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var f=a.tag;if(f===3||f===4){var v=a.stateNode.containerInfo;if(v===s)break;if(f===4)for(f=a.return;f!==null;){var C=f.tag;if((C===3||C===4)&&f.stateNode.containerInfo===s)return;f=f.return}for(;v!==null;){if(f=kn(v),f===null)return;if(C=f.tag,C===5||C===6||C===26||C===27){a=r=f;continue e}v=v.parentNode}}a=a.return}mu(function(){var H=r,V=zr(n),J=[];e:{var $=Wu.get(e);if($!==void 0){var Y=ns,fe=e;switch(e){case"keypress":if(es(n)===0)break e;case"keydown":case"keyup":Y=Rv;break;case"focusin":fe="focus",Y=Dr;break;case"focusout":fe="blur",Y=Dr;break;case"beforeblur":case"afterblur":Y=Dr;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=xu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=jv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=Uv;break;case qu:case Lu:case Yu:Y=wv;break;case Gu:Y=Bv;break;case"scroll":case"scrollend":Y=xv;break;case"wheel":Y=qv;break;case"copy":case"cut":case"paste":Y=Cv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=ju;break;case"toggle":case"beforetoggle":Y=Yv}var ye=(t&4)!==0,Ge=!ye&&(e==="scroll"||e==="scrollend"),D=ye?$!==null?$+"Capture":null:$;ye=[];for(var E=H,U;E!==null;){var K=E;if(U=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||U===null||D===null||(K=Vl(E,D),K!=null&&ye.push(zi(E,K,U))),Ge)break;E=E.return}0<ye.length&&($=new Y($,fe,null,n,V),J.push({event:$,listeners:ye}))}}if((t&7)===0){e:{if($=e==="mouseover"||e==="pointerover",Y=e==="mouseout"||e==="pointerout",$&&n!==wr&&(fe=n.relatedTarget||n.fromElement)&&(kn(fe)||fe[cn]))break e;if((Y||$)&&($=V.window===V?V:($=V.ownerDocument)?$.defaultView||$.parentWindow:window,Y?(fe=n.relatedTarget||n.toElement,Y=H,fe=fe?kn(fe):null,fe!==null&&(Ge=h(fe),ye=fe.tag,fe!==Ge||ye!==5&&ye!==27&&ye!==6)&&(fe=null)):(Y=null,fe=H),Y!==fe)){if(ye=xu,K="onMouseLeave",D="onMouseEnter",E="mouse",(e==="pointerout"||e==="pointerover")&&(ye=ju,K="onPointerLeave",D="onPointerEnter",E="pointer"),Ge=Y==null?$:Vn(Y),U=fe==null?$:Vn(fe),$=new ye(K,E+"leave",Y,n,V),$.target=Ge,$.relatedTarget=U,K=null,kn(V)===H&&(ye=new ye(D,E+"enter",fe,n,V),ye.target=U,ye.relatedTarget=Ge,K=ye),Ge=K,Y&&fe)t:{for(ye=Lm,D=Y,E=fe,U=0,K=D;K;K=ye(K))U++;K=0;for(var ve=E;ve;ve=ye(ve))K++;for(;0<U-K;)D=ye(D),U--;for(;0<K-U;)E=ye(E),K--;for(;U--;){if(D===E||E!==null&&D===E.alternate){ye=D;break t}D=ye(D),E=ye(E)}ye=null}else ye=null;Y!==null&&hh(J,$,Y,ye,!1),fe!==null&&Ge!==null&&hh(J,Ge,fe,ye,!0)}}e:{if($=H?Vn(H):window,Y=$.nodeName&&$.nodeName.toLowerCase(),Y==="select"||Y==="input"&&$.type==="file")var Re=Eu;else if(Tu($))if(_u)Re=Iv;else{Re=Fv;var pe=Zv}else Y=$.nodeName,!Y||Y.toLowerCase()!=="input"||$.type!=="checkbox"&&$.type!=="radio"?H&&kr(H.elementType)&&(Re=Eu):Re=Jv;if(Re&&(Re=Re(e,H))){Mu(J,Re,n,V);break e}pe&&pe(e,$,H),e==="focusout"&&H&&$.type==="number"&&H.memoizedProps.value!=null&&Sr($,"number",$.value)}switch(pe=H?Vn(H):window,e){case"focusin":(Tu(pe)||pe.contentEditable==="true")&&(ll=pe,Hr=H,ei=null);break;case"focusout":ei=Hr=ll=null;break;case"mousedown":Br=!0;break;case"contextmenu":case"mouseup":case"dragend":Br=!1,Bu(J,n,V);break;case"selectionchange":if(em)break;case"keydown":case"keyup":Bu(J,n,V)}var we;if(Rr)e:{switch(e){case"compositionstart":var _e="onCompositionStart";break e;case"compositionend":_e="onCompositionEnd";break e;case"compositionupdate":_e="onCompositionUpdate";break e}_e=void 0}else al?zu(e,n)&&(_e="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(_e="onCompositionStart");_e&&(Su&&n.locale!=="ko"&&(al||_e!=="onCompositionStart"?_e==="onCompositionEnd"&&al&&(we=gu()):(Kn=V,Mr="value"in Kn?Kn.value:Kn.textContent,al=!0)),pe=Vs(H,_e),0<pe.length&&(_e=new bu(_e,e,null,n,V),J.push({event:_e,listeners:pe}),we?_e.data=we:(we=Cu(n),we!==null&&(_e.data=we)))),(we=Wv?Xv(e,n):Vv(e,n))&&(_e=Vs(H,"onBeforeInput"),0<_e.length&&(pe=new bu("onBeforeInput","beforeinput",null,n,V),J.push({event:pe,listeners:_e}),pe.data=we)),Hm(J,e,H,n,V)}dh(J,t)})}function zi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Vs(e,t){for(var n=t+"Capture",a=[];e!==null;){var s=e,r=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||r===null||(s=Vl(e,n),s!=null&&a.unshift(zi(e,s,r)),s=Vl(e,t),s!=null&&a.push(zi(e,s,r))),e.tag===3)return a;e=e.return}return[]}function Lm(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function hh(e,t,n,a,s){for(var r=t._reactName,f=[];n!==null&&n!==a;){var v=n,C=v.alternate,H=v.stateNode;if(v=v.tag,C!==null&&C===a)break;v!==5&&v!==26&&v!==27||H===null||(C=H,s?(H=Vl(n,r),H!=null&&f.unshift(zi(n,H,C))):s||(H=Vl(n,r),H!=null&&f.push(zi(n,H,C)))),n=n.return}f.length!==0&&e.push({event:t,listeners:f})}var Ym=/\r\n?/g,Gm=/\u0000|\uFFFD/g;function ph(e){return(typeof e=="string"?e:""+e).replace(Ym,`
|
|
9
|
+
`).replace(Gm,"")}function vh(e,t){return t=ph(t),ph(e)===t}function Ye(e,t,n,a,s,r){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||el(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&el(e,""+a);break;case"className":Fi(e,"class",a);break;case"tabIndex":Fi(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Fi(e,n,a);break;case"style":pu(e,a,r);break;case"data":if(t!=="object"){Fi(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Ii(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"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 r=="function"&&(n==="formAction"?(t!=="input"&&Ye(e,t,"name",s.name,s,null),Ye(e,t,"formEncType",s.formEncType,s,null),Ye(e,t,"formMethod",s.formMethod,s,null),Ye(e,t,"formTarget",s.formTarget,s,null)):(Ye(e,t,"encType",s.encType,s,null),Ye(e,t,"method",s.method,s,null),Ye(e,t,"target",s.target,s,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Ii(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=Tn);break;case"onScroll":a!=null&&Me("scroll",e);break;case"onScrollEnd":a!=null&&Me("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(n=a.__html,n!=null){if(s.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=Ii(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":Me("beforetoggle",e),Me("toggle",e),Zi(e,"popover",a);break;case"xlinkActuate":Cn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Cn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Cn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Cn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Cn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Cn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Cn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Cn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Cn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Zi(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=gv.get(n)||n,Zi(e,n,a))}}function uc(e,t,n,a,s,r){switch(n){case"style":pu(e,a,r);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(n=a.__html,n!=null){if(s.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"children":typeof a=="string"?el(e,a):(typeof a=="number"||typeof a=="bigint")&&el(e,""+a);break;case"onScroll":a!=null&&Me("scroll",e);break;case"onScrollEnd":a!=null&&Me("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Tn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Wl.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(s=n.endsWith("Capture"),t=n.slice(2,s?n.length-7:void 0),r=e[gt]||null,r=r!=null?r[n]:null,typeof r=="function"&&e.removeEventListener(t,r,s),typeof a=="function")){typeof r!="function"&&r!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,s);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):Zi(e,n,a)}}}function ht(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Me("error",e),Me("load",e);var a=!1,s=!1,r;for(r in n)if(n.hasOwnProperty(r)){var f=n[r];if(f!=null)switch(r){case"src":a=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ye(e,t,r,f,n,null)}}s&&Ye(e,t,"srcSet",n.srcSet,n,null),a&&Ye(e,t,"src",n.src,n,null);return;case"input":Me("invalid",e);var v=r=f=s=null,C=null,H=null;for(a in n)if(n.hasOwnProperty(a)){var V=n[a];if(V!=null)switch(a){case"name":s=V;break;case"type":f=V;break;case"checked":C=V;break;case"defaultChecked":H=V;break;case"value":r=V;break;case"defaultValue":v=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(o(137,t));break;default:Ye(e,t,a,V,n,null)}}uu(e,r,v,C,H,f,s,!1);return;case"select":Me("invalid",e),a=f=r=null;for(s in n)if(n.hasOwnProperty(s)&&(v=n[s],v!=null))switch(s){case"value":r=v;break;case"defaultValue":f=v;break;case"multiple":a=v;default:Ye(e,t,s,v,n,null)}t=r,n=f,e.multiple=!!a,t!=null?Pa(e,!!a,t,!1):n!=null&&Pa(e,!!a,n,!0);return;case"textarea":Me("invalid",e),r=s=a=null;for(f in n)if(n.hasOwnProperty(f)&&(v=n[f],v!=null))switch(f){case"value":a=v;break;case"defaultValue":s=v;break;case"children":r=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(o(91));break;default:Ye(e,t,f,v,n,null)}fu(e,a,s,r);return;case"option":for(C in n)n.hasOwnProperty(C)&&(a=n[C],a!=null)&&(C==="selected"?e.selected=a&&typeof a!="function"&&typeof a!="symbol":Ye(e,t,C,a,n,null));return;case"dialog":Me("beforetoggle",e),Me("toggle",e),Me("cancel",e),Me("close",e);break;case"iframe":case"object":Me("load",e);break;case"video":case"audio":for(a=0;a<wi.length;a++)Me(wi[a],e);break;case"image":Me("error",e),Me("load",e);break;case"details":Me("toggle",e);break;case"embed":case"source":case"link":Me("error",e),Me("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(H in n)if(n.hasOwnProperty(H)&&(a=n[H],a!=null))switch(H){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ye(e,t,H,a,n,null)}return;default:if(kr(t)){for(V in n)n.hasOwnProperty(V)&&(a=n[V],a!==void 0&&uc(e,t,V,a,n,void 0));return}}for(v in n)n.hasOwnProperty(v)&&(a=n[v],a!=null&&Ye(e,t,v,a,n,null))}function Wm(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,r=null,f=null,v=null,C=null,H=null,V=null;for(Y in n){var J=n[Y];if(n.hasOwnProperty(Y)&&J!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":C=J;default:a.hasOwnProperty(Y)||Ye(e,t,Y,null,a,J)}}for(var $ in a){var Y=a[$];if(J=n[$],a.hasOwnProperty($)&&(Y!=null||J!=null))switch($){case"type":r=Y;break;case"name":s=Y;break;case"checked":H=Y;break;case"defaultChecked":V=Y;break;case"value":f=Y;break;case"defaultValue":v=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(o(137,t));break;default:Y!==J&&Ye(e,t,$,Y,a,J)}}jr(e,f,v,C,H,V,r,s);return;case"select":Y=f=v=$=null;for(r in n)if(C=n[r],n.hasOwnProperty(r)&&C!=null)switch(r){case"value":break;case"multiple":Y=C;default:a.hasOwnProperty(r)||Ye(e,t,r,null,a,C)}for(s in a)if(r=a[s],C=n[s],a.hasOwnProperty(s)&&(r!=null||C!=null))switch(s){case"value":$=r;break;case"defaultValue":v=r;break;case"multiple":f=r;default:r!==C&&Ye(e,t,s,r,a,C)}t=v,n=f,a=Y,$!=null?Pa(e,!!n,$,!1):!!a!=!!n&&(t!=null?Pa(e,!!n,t,!0):Pa(e,!!n,n?[]:"",!1));return;case"textarea":Y=$=null;for(v in n)if(s=n[v],n.hasOwnProperty(v)&&s!=null&&!a.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:Ye(e,t,v,null,a,s)}for(f in a)if(s=a[f],r=n[f],a.hasOwnProperty(f)&&(s!=null||r!=null))switch(f){case"value":$=s;break;case"defaultValue":Y=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(o(91));break;default:s!==r&&Ye(e,t,f,s,a,r)}du(e,$,Y);return;case"option":for(var fe in n)$=n[fe],n.hasOwnProperty(fe)&&$!=null&&!a.hasOwnProperty(fe)&&(fe==="selected"?e.selected=!1:Ye(e,t,fe,null,a,$));for(C in a)$=a[C],Y=n[C],a.hasOwnProperty(C)&&$!==Y&&($!=null||Y!=null)&&(C==="selected"?e.selected=$&&typeof $!="function"&&typeof $!="symbol":Ye(e,t,C,$,a,Y));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 ye in n)$=n[ye],n.hasOwnProperty(ye)&&$!=null&&!a.hasOwnProperty(ye)&&Ye(e,t,ye,null,a,$);for(H in a)if($=a[H],Y=n[H],a.hasOwnProperty(H)&&$!==Y&&($!=null||Y!=null))switch(H){case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(o(137,t));break;default:Ye(e,t,H,$,a,Y)}return;default:if(kr(t)){for(var Ge in n)$=n[Ge],n.hasOwnProperty(Ge)&&$!==void 0&&!a.hasOwnProperty(Ge)&&uc(e,t,Ge,void 0,a,$);for(V in a)$=a[V],Y=n[V],!a.hasOwnProperty(V)||$===Y||$===void 0&&Y===void 0||uc(e,t,V,$,a,Y);return}}for(var D in n)$=n[D],n.hasOwnProperty(D)&&$!=null&&!a.hasOwnProperty(D)&&Ye(e,t,D,null,a,$);for(J in a)$=a[J],Y=n[J],!a.hasOwnProperty(J)||$===Y||$==null&&Y==null||Ye(e,t,J,$,a,Y)}function mh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Xm(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var s=n[a],r=s.transferSize,f=s.initiatorType,v=s.duration;if(r&&v&&mh(f)){for(f=0,v=s.responseEnd,a+=1;a<n.length;a++){var C=n[a],H=C.startTime;if(H>v)break;var V=C.transferSize,J=C.initiatorType;V&&mh(J)&&(C=C.responseEnd,f+=V*(C<v?1:(v-H)/(C-H)))}if(--a,t+=8*(r+f)/(s.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var dc=null,fc=null;function Qs(e){return e.nodeType===9?e:e.ownerDocument}function gh(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function yh(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function hc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var pc=null;function Vm(){var e=window.event;return e&&e.type==="popstate"?e===pc?!1:(pc=e,!0):(pc=null,!1)}var xh=typeof setTimeout=="function"?setTimeout:void 0,Qm=typeof clearTimeout=="function"?clearTimeout:void 0,bh=typeof Promise=="function"?Promise:void 0,Km=typeof queueMicrotask=="function"?queueMicrotask:typeof bh<"u"?function(e){return bh.resolve(null).then(e).catch(Zm)}:xh;function Zm(e){setTimeout(function(){throw e})}function da(e){return e==="head"}function jh(e,t){var n=t,a=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(s),Dl(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")Ci(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Ci(n);for(var r=n.firstChild;r;){var f=r.nextSibling,v=r.nodeName;r[Sn]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&r.rel.toLowerCase()==="stylesheet"||n.removeChild(r),r=f}}else n==="body"&&Ci(e.ownerDocument.body);n=s}while(n);Dl(t)}function Sh(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function vc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":vc(n),Ia(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Fm(e,t,n,a){for(;e.nodeType===1;){var s=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[Sn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=Ft(e.nextSibling),e===null)break}return null}function Jm(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Ft(e.nextSibling),e===null))return null;return e}function kh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ft(e.nextSibling),e===null))return null;return e}function mc(e){return e.data==="$?"||e.data==="$~"}function gc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Im(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function Ft(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var yc=null;function wh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Ft(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function zh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Ch(e,t,n){switch(t=Qs(n),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Ci(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ia(e)}var Jt=new Map,Th=new Set;function Ks(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Gn=q.d;q.d={f:Pm,r:eg,D:tg,C:ng,L:ag,m:lg,X:sg,S:ig,M:rg};function Pm(){var e=Gn.f(),t=$s();return e||t}function eg(e){var t=wn(e);t!==null&&t.tag===5&&t.type==="form"?Gd(t):Gn.r(e)}var Ml=typeof document>"u"?null:document;function Mh(e,t,n){var a=Ml;if(a&&typeof t=="string"&&t){var s=Gt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof n=="string"&&(s+='[crossorigin="'+n+'"]'),Th.has(s)||(Th.add(s),e={rel:e,crossOrigin:n,href:t},a.querySelector(s)===null&&(t=a.createElement("link"),ht(t,"link",e),at(t),a.head.appendChild(t)))}}function tg(e){Gn.D(e),Mh("dns-prefetch",e,null)}function ng(e,t){Gn.C(e,t),Mh("preconnect",e,t)}function ag(e,t,n){Gn.L(e,t,n);var a=Ml;if(a&&e&&t){var s='link[rel="preload"][as="'+Gt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(s+='[imagesrcset="'+Gt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(s+='[imagesizes="'+Gt(n.imageSizes)+'"]')):s+='[href="'+Gt(e)+'"]';var r=s;switch(t){case"style":r=El(e);break;case"script":r=_l(e)}Jt.has(r)||(e=b({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Jt.set(r,e),a.querySelector(s)!==null||t==="style"&&a.querySelector(Ti(r))||t==="script"&&a.querySelector(Mi(r))||(t=a.createElement("link"),ht(t,"link",e),at(t),a.head.appendChild(t)))}}function lg(e,t){Gn.m(e,t);var n=Ml;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Gt(a)+'"][href="'+Gt(e)+'"]',r=s;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=_l(e)}if(!Jt.has(r)&&(e=b({rel:"modulepreload",href:e},t),Jt.set(r,e),n.querySelector(s)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Mi(r)))return}a=n.createElement("link"),ht(a,"link",e),at(a),n.head.appendChild(a)}}}function ig(e,t,n){Gn.S(e,t,n);var a=Ml;if(a&&e){var s=zn(a).hoistableStyles,r=El(e);t=t||"default";var f=s.get(r);if(!f){var v={loading:0,preload:null};if(f=a.querySelector(Ti(r)))v.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Jt.get(r))&&xc(e,n);var C=f=a.createElement("link");at(C),ht(C,"link",e),C._p=new Promise(function(H,V){C.onload=H,C.onerror=V}),C.addEventListener("load",function(){v.loading|=1}),C.addEventListener("error",function(){v.loading|=2}),v.loading|=4,Zs(f,t,a)}f={type:"stylesheet",instance:f,count:1,state:v},s.set(r,f)}}}function sg(e,t){Gn.X(e,t);var n=Ml;if(n&&e){var a=zn(n).hoistableScripts,s=_l(e),r=a.get(s);r||(r=n.querySelector(Mi(s)),r||(e=b({src:e,async:!0},t),(t=Jt.get(s))&&bc(e,t),r=n.createElement("script"),at(r),ht(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function rg(e,t){Gn.M(e,t);var n=Ml;if(n&&e){var a=zn(n).hoistableScripts,s=_l(e),r=a.get(s);r||(r=n.querySelector(Mi(s)),r||(e=b({src:e,async:!0,type:"module"},t),(t=Jt.get(s))&&bc(e,t),r=n.createElement("script"),at(r),ht(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function Eh(e,t,n,a){var s=(s=oe.current)?Ks(s):null;if(!s)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=El(n.href),n=zn(s).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=El(n.href);var r=zn(s).hoistableStyles,f=r.get(e);if(f||(s=s.ownerDocument||s,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,f),(r=s.querySelector(Ti(e)))&&!r._p&&(f.instance=r,f.state.loading=5),Jt.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Jt.set(e,n),r||og(s,e,n,f.state))),t&&a===null)throw Error(o(528,""));return f}if(t&&a!==null)throw Error(o(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=_l(n),n=zn(s).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function El(e){return'href="'+Gt(e)+'"'}function Ti(e){return'link[rel="stylesheet"]['+e+"]"}function _h(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function og(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),ht(t,"link",n),at(t),e.head.appendChild(t))}function _l(e){return'[src="'+Gt(e)+'"]'}function Mi(e){return"script[async]"+e}function Dh(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Gt(n.href)+'"]');if(a)return t.instance=a,at(a),a;var s=b({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),at(a),ht(a,"style",s),Zs(a,n.precedence,e),t.instance=a;case"stylesheet":s=El(n.href);var r=e.querySelector(Ti(s));if(r)return t.state.loading|=4,t.instance=r,at(r),r;a=_h(n),(s=Jt.get(s))&&xc(a,s),r=(e.ownerDocument||e).createElement("link"),at(r);var f=r;return f._p=new Promise(function(v,C){f.onload=v,f.onerror=C}),ht(r,"link",a),t.state.loading|=4,Zs(r,n.precedence,e),t.instance=r;case"script":return r=_l(n.src),(s=e.querySelector(Mi(r)))?(t.instance=s,at(s),s):(a=n,(s=Jt.get(r))&&(a=b({},n),bc(a,s)),e=e.ownerDocument||e,s=e.createElement("script"),at(s),ht(s,"link",a),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Zs(a,n.precedence,e));return t.instance}function Zs(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=a.length?a[a.length-1]:null,r=s,f=0;f<a.length;f++){var v=a[f];if(v.dataset.precedence===t)r=v;else if(r!==s)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function xc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function bc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Fs=null;function Ah(e,t,n){if(Fs===null){var a=new Map,s=Fs=new Map;s.set(n,a)}else s=Fs,a=s.get(n),a||(a=new Map,s.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),s=0;s<n.length;s++){var r=n[s];if(!(r[Sn]||r[Je]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var f=r.getAttribute(t)||"";f=e+f;var v=a.get(f);v?v.push(r):a.set(f,[r])}}return a}function Rh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function cg(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Oh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function ug(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var s=El(a.href),r=t.querySelector(Ti(s));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Js.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=r,at(r);return}r=t.ownerDocument||t,a=_h(a),(s=Jt.get(s))&&xc(a,s),r=r.createElement("link"),at(r);var f=r;f._p=new Promise(function(v,C){f.onload=v,f.onerror=C}),ht(r,"link",a),n.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Js.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var jc=0;function dg(e,t){return e.stylesheets&&e.count===0&&Ps(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&Ps(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&jc===0&&(jc=62500*Xm());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ps(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>jc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(s)}}:null}function Js(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ps(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Is=null;function Ps(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Is=new Map,t.forEach(fg,e),Is=null,Js.call(e))}function fg(e,t){if(!(t.state.loading&4)){var n=Is.get(e);if(n)var a=n.get(null);else{n=new Map,Is.set(e,n);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<s.length;r++){var f=s[r];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(n.set(f.dataset.precedence,f),a=f)}a&&n.set(null,a)}s=t.instance,f=s.getAttribute("data-precedence"),r=n.get(f)||a,r===a&&n.set(null,s),n.set(f,s),this.count++,a=Js.bind(this),s.addEventListener("load",a),s.addEventListener("error",a),r?r.parentNode.insertBefore(s,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var Ei={$$typeof:N,Provider:null,Consumer:null,_currentValue:O,_currentValue2:O,_threadCount:0};function hg(e,t,n,a,s,r,f,v,C){this.tag=1,this.containerInfo=e,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=Ka(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ka(0),this.hiddenUpdates=Ka(null),this.identifierPrefix=a,this.onUncaughtError=s,this.onCaughtError=r,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=C,this.incompleteTransitions=new Map}function Nh(e,t,n,a,s,r,f,v,C,H,V,J){return e=new hg(e,t,n,f,C,H,V,J,v),t=1,r===!0&&(t|=24),r=Rt(3,null,null,t),e.current=r,r.stateNode=e,t=Pr(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:a,isDehydrated:n,cache:t},ao(r),e}function Uh(e){return e?(e=rl,e):rl}function Hh(e,t,n,a,s,r){s=Uh(s),a.context===null?a.context=s:a.pendingContext=s,a=ea(t),a.payload={element:n},r=r===void 0?null:r,r!==null&&(a.callback=r),n=ta(e,a,t),n!==null&&(Dt(n,e,t),ri(n,e,t))}function Bh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Sc(e,t){Bh(e,t),(e=e.alternate)&&Bh(e,t)}function $h(e){if(e.tag===13||e.tag===31){var t=Ma(e,67108864);t!==null&&Dt(t,e,67108864),Sc(e,67108864)}}function qh(e){if(e.tag===13||e.tag===31){var t=Bt();t=wa(t);var n=Ma(e,t);n!==null&&Dt(n,e,t),Sc(e,t)}}var er=!0;function pg(e,t,n,a){var s=j.T;j.T=null;var r=q.p;try{q.p=2,kc(e,t,n,a)}finally{q.p=r,j.T=s}}function vg(e,t,n,a){var s=j.T;j.T=null;var r=q.p;try{q.p=8,kc(e,t,n,a)}finally{q.p=r,j.T=s}}function kc(e,t,n,a){if(er){var s=wc(a);if(s===null)cc(e,t,a,tr,n),Yh(e,a);else if(gg(s,e,t,n,a))a.stopPropagation();else if(Yh(e,a),t&4&&-1<mg.indexOf(e)){for(;s!==null;){var r=wn(s);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var f=qt(r.pendingLanes);if(f!==0){var v=r;for(v.pendingLanes|=2,v.entangledLanes|=2;f;){var C=1<<31-jt(f);v.entanglements[1]|=C,f&=~C}hn(r),(Ne&6)===0&&(Hs=bt()+500,ki(0))}}break;case 31:case 13:v=Ma(r,2),v!==null&&Dt(v,r,2),$s(),Sc(r,2)}if(r=wc(a),r===null&&cc(e,t,a,tr,n),r===s)break;s=r}s!==null&&a.stopPropagation()}else cc(e,t,a,null,n)}}function wc(e){return e=zr(e),zc(e)}var tr=null;function zc(e){if(tr=null,e=kn(e),e!==null){var t=h(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=m(t),e!==null)return e;e=null}else if(n===31){if(e=y(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return tr=e,null}function Lh(e){switch(e){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(Xa()){case $l:return 2;case ql:return 8;case Va:case Li:return 32;case xa:return 268435456;default:return 32}default:return 32}}var Cc=!1,fa=null,ha=null,pa=null,_i=new Map,Di=new Map,va=[],mg="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 Yh(e,t){switch(e){case"focusin":case"focusout":fa=null;break;case"dragenter":case"dragleave":ha=null;break;case"mouseover":case"mouseout":pa=null;break;case"pointerover":case"pointerout":_i.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Di.delete(t.pointerId)}}function Ai(e,t,n,a,s,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:r,targetContainers:[s]},t!==null&&(t=wn(t),t!==null&&$h(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function gg(e,t,n,a,s){switch(t){case"focusin":return fa=Ai(fa,e,t,n,a,s),!0;case"dragenter":return ha=Ai(ha,e,t,n,a,s),!0;case"mouseover":return pa=Ai(pa,e,t,n,a,s),!0;case"pointerover":var r=s.pointerId;return _i.set(r,Ai(_i.get(r)||null,e,t,n,a,s)),!0;case"gotpointercapture":return r=s.pointerId,Di.set(r,Ai(Di.get(r)||null,e,t,n,a,s)),!0}return!1}function Gh(e){var t=kn(e.target);if(t!==null){var n=h(t);if(n!==null){if(t=n.tag,t===13){if(t=m(n),t!==null){e.blockedOn=t,Vi(e.priority,function(){qh(n)});return}}else if(t===31){if(t=y(n),t!==null){e.blockedOn=t,Vi(e.priority,function(){qh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function nr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=wc(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);wr=a,n.target.dispatchEvent(a),wr=null}else return t=wn(n),t!==null&&$h(t),e.blockedOn=n,!1;t.shift()}return!0}function Wh(e,t,n){nr(e)&&n.delete(t)}function yg(){Cc=!1,fa!==null&&nr(fa)&&(fa=null),ha!==null&&nr(ha)&&(ha=null),pa!==null&&nr(pa)&&(pa=null),_i.forEach(Wh),Di.forEach(Wh)}function ar(e,t){e.blockedOn===t&&(e.blockedOn=null,Cc||(Cc=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,yg)))}var lr=null;function Xh(e){lr!==e&&(lr=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){lr===e&&(lr=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],s=e[t+2];if(typeof a!="function"){if(zc(a||n)===null)continue;break}var r=wn(n);r!==null&&(e.splice(t,3),t-=3,wo(r,{pending:!0,data:s,method:n.method,action:a},a,s))}}))}function Dl(e){function t(C){return ar(C,e)}fa!==null&&ar(fa,e),ha!==null&&ar(ha,e),pa!==null&&ar(pa,e),_i.forEach(t),Di.forEach(t);for(var n=0;n<va.length;n++){var a=va[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<va.length&&(n=va[0],n.blockedOn===null);)Gh(n),n.blockedOn===null&&va.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var s=n[a],r=n[a+1],f=s[gt]||null;if(typeof r=="function")f||Xh(n);else if(f){var v=null;if(r&&r.hasAttribute("formAction")){if(s=r,f=r[gt]||null)v=f.formAction;else if(zc(s)!==null)continue}else v=f.action;typeof v=="function"?n[a+1]=v:(n.splice(a,3),a-=3),Xh(n)}}}function Vh(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(f){return s=f})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function Tc(e){this._internalRoot=e}ir.prototype.render=Tc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,a=Bt();Hh(n,a,e,t,null,null)},ir.prototype.unmount=Tc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Hh(e.current,2,null,e,null,null),$s(),t[cn]=null}};function ir(e){this._internalRoot=e}ir.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xi();e={blockedOn:null,target:e,priority:t};for(var n=0;n<va.length&&t!==0&&t<va[n].priority;n++);va.splice(n,0,e),n===0&&Gh(e)}};var Qh=c.version;if(Qh!=="19.2.8")throw Error(o(527,Qh,"19.2.8"));q.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=p(t),e=e!==null?S(e):null,e=e===null?null:e.stateNode,e};var xg={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var sr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sr.isDisabled&&sr.supportsFiber)try{ba=sr.inject(xg),mt=sr}catch{}}return Oi.createRoot=function(e,t){if(!d(e))throw Error(o(299));var n=!1,a="",s=Pd,r=ef,f=tf;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=Nh(e,1,!1,null,null,n,a,null,s,r,f,Vh),e[cn]=t.current,oc(e),new Tc(t)},Oi.hydrateRoot=function(e,t,n){if(!d(e))throw Error(o(299));var a=!1,s="",r=Pd,f=ef,v=tf,C=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(r=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError),n.formState!==void 0&&(C=n.formState)),t=Nh(e,1,!0,t,n??null,a,s,C,r,f,v,Vh),t.context=Uh(null),n=t.current,a=Bt(),a=wa(a),s=ea(a),s.callback=null,ta(n,s,a),n=a,t.current.lanes=n,xn(t,n),hn(t),e[cn]=t.current,oc(e),new ir(t)},Oi.version="19.2.8",Oi}var ap;function _g(){if(ap)return _c.exports;ap=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),_c.exports=Eg(),_c.exports}var Dg=_g();const Ag=["run_started","run_resumed","run_finished","run_error","run_titled","cost","budget_alert","budget_stop","usage_limit","mission_incomplete","mission_done_at_cap","settings_changed","message","steer","worker_started","worker_progress","worker_finished","worker_stalled","worker_looping","director_looping","service_exposed","auto_allowed","auto_denied","root_allowed","permission_request","permission_resolved","permission_timeout","question","question_answered","question_timeout","chat_message","chat_turn","chat_cost","chat_error","chat_cleared","chat_proposal_dismissed","chat_question","chat_answered","chat_question_timeout","mission_proposed","models_changed","git_branch","git_note","git_committed","pull_request","memory_updated","mission_doc_restored","run_note","schedule_paused","schedule_skipped"],Fc=new Set,pr=new Set;let Ni=null;function Yp(){if(!Ni){Ni=new EventSource("/events"),Ni.onopen=()=>pr.forEach(i=>i(!0)),Ni.onerror=()=>pr.forEach(i=>i(!1));for(const i of Ag)Ni.addEventListener(i,c=>{const u=JSON.parse(c.data);Fc.forEach(o=>o(i,u))})}}function Ol(i){return Yp(),Fc.add(i),()=>Fc.delete(i)}function Rg(i){return Yp(),pr.add(i),()=>pr.delete(i)}function ga(i){return i.costBasis==="priced"||i.costBasis==="free"||i.costBasis==="unpriced"?i.costBasis:i.metered===!1?"unpriced":"priced"}function Gp(i){if(i)switch(i.kind){case"claude-code":return i.configDir;case"codex":return i.codexHome??"~/.codex";case"openai-compatible":return i.baseUrl;case"anthropic-api":return`$${i.apiKeyEnv}`}}const au={runStatus:"idle",mission:"",title:"",costBasis:"priced",usage:null,costUsd:0,budgetUsd:5,agents:[],entries:[],approvals:[],questions:[],missionDoc:null,services:[]};let He=0;function Wp(i,c,u){const o=[],d=(h,m,y)=>o.push({id:++He,ts:u,agent:i,kind:h,title:m,body:y});if(c.type==="system"&&c.subtype==="init")d("system","init",`model: ${c.model??"?"}`);else if(c.type==="assistant"){for(const h of c.message?.content??[])if(h.type==="text"&&h.text?.trim())d("text",i,h.text);else if(h.type==="tool_use"){const m=String(h.name).replace("mcp__foreman__","").replace("mcp__playwright__","");d("tool",m,JSON.stringify(h.input).slice(0,4e3))}}else if(c.type==="user"&&Array.isArray(c.message?.content)){for(const h of c.message.content)if(h.type==="tool_result"){const m=typeof h.content=="string"?h.content:(h.content??[]).map(y=>y.text??"").join("");d("result","result",String(m).slice(0,700))}}else c.type==="result"&&d(c.is_error?"error":"system",`result · ${c.subtype??""}`,String(c.result??"").slice(0,2500));return o}const lp=i=>String(i??"").replace(/\s+/g," ").trim();function Og(i,c){if(i.kind==="system"&&i.title.startsWith("result ·")&&i.body){for(let u=c.length-1;u>=0&&u>=c.length-40;u--){const o=c[u];if(o.agent===i.agent&&o.kind==="text"){const d=lp(o.body),h=lp(i.body);return d.length>=40&&h.length>=40&&(d.startsWith(h)||h.startsWith(d))?{...i,body:""}:i}}return i}if(i.kind==="result"){const u=/^\[(worker-\d+) (finished|failed|done|started|resumed|stalled|interrupted)\]\s*/.exec(i.body);if(u){const o=i.body.slice(u[0].length).split(`
|
|
10
|
+
`).find(d=>d.trim())??"";return{...i,title:`${u[1]} ${u[2]}`,body:o.length>160?`${o.slice(0,159).trimEnd()}…`:o}}}return i}function Ng(i,c){const u=c.ts??Date.now(),o=c.data;switch(c.event){case"run_started":return{...au,missionDoc:i.missionDoc,runStatus:"running",mission:o.mission,budgetUsd:o.budgetUsd,costBasis:ga(o),usage:o.usage??null,agents:[{id:"director",status:"running"}]};case"run_resumed":{const d=i.agents.filter(h=>h.id!=="director").map(h=>h.status==="running"?{...h,status:"interrupted"}:h);return{...i,runStatus:"running",mission:o.mission??i.mission,budgetUsd:o.budgetUsd??i.budgetUsd,costUsd:o.costUsd??i.costUsd,costBasis:o.costBasis||o.metered!==void 0?ga(o):i.costBasis,usage:o.usage??i.usage,agents:[{id:"director",status:"running"},...d],entries:[...i.entries,{id:++He,ts:u,agent:"system",kind:"system",title:"mission resumed",body:"Director session restored; re-verifying state against MISSION.md."}]}}case"run_finished":return{...i,runStatus:o.status||"done",costUsd:o.costUsd??i.costUsd,approvals:[],questions:[],agents:i.agents.map(d=>d.id==="director"?{...d,status:o.status||"done"}:d)};case"mission_done_at_cap":return{...i,entries:[...i.entries,{id:++He,ts:u,agent:"system",kind:"system",title:"done, at the cap",body:String(o.text??"")}]};case"mission_incomplete":return{...i,entries:[...i.entries,{id:++He,ts:u,agent:"system",kind:"error",title:"not done",body:[o.text,"",...(o.unmet??[]).map(d=>`▢ ${d}`)].join(`
|
|
11
|
+
`)}]};case"run_error":return{...i,entries:[...i.entries,{id:++He,ts:u,agent:"system",kind:"error",title:"error",body:o.error}]};case"worker_stalled":return{...i,entries:[...i.entries,{id:++He,ts:u,agent:String(o.id??"worker"),kind:"error",title:"worker stalled",body:String(o.text??"Worker produced no output and was stopped.")}]};case"worker_looping":return{...i,entries:[...i.entries,{id:++He,ts:u,agent:String(o.id??"worker"),kind:"error",title:"worker looping",body:String(o.text??`Worker repeated the identical ${String(o.toolName??"tool")} call ${String(o.count??"?")} times and was stopped.`)}]};case"director_looping":return{...i,entries:[...i.entries,{id:++He,ts:u,agent:"director",kind:"error",title:"director looping",body:String(o.text??`Director issued the identical ${String(o.toolName??"tool")} call ${String(o.count??"?")} times in a row — notified.`)}]};case"settings_changed":return{...i,budgetUsd:typeof o.budgetUsd=="number"?o.budgetUsd:i.budgetUsd,entries:[...i.entries,{id:++He,ts:u,agent:"system",kind:"steer",title:"settings changed",body:(o.changes??[]).join(`
|
|
12
|
+
`)}]};case"run_titled":return{...i,title:String(o.title??"")};case"cost":return{...i,costUsd:o.costUsd,budgetUsd:o.budgetUsd,usage:o.usage??i.usage,costBasis:ga(o)};case"message":{const d=o.agent==="director"&&o.msg?.session_id?{directorSessionId:o.msg.session_id}:{},h=Wp(o.agent,o.msg,u).map(m=>Og(m,i.entries));return h.length||d.directorSessionId?{...i,...d,entries:[...i.entries.slice(-1499),...h]}:i}case"steer":return{...i,entries:[...i.entries,{id:++He,ts:u,agent:"you",kind:"steer",title:"steer",body:o.text,to:o.to,timing:o.timing}]};case"usage_limit":return{...i,entries:[...i.entries,{id:++He,ts:u,agent:"system",kind:"error",title:"usage limit",body:o.text}]};case"models_changed":return{...i,entries:[...i.entries,{id:++He,ts:u,agent:"system",kind:"system",title:"models changed",body:o.text}]};case"memory_updated":return{...i,entries:[...i.entries,{id:++He,ts:u,agent:"system",kind:"system",title:"memory",body:String(o.text??"Project memory rewritten.")}]};case"pull_request":return{...i,entries:[...i.entries,{id:++He,ts:u,agent:"system",kind:o.error?"error":"system",title:o.method==="gh"?"pull request":"branch pushed",body:String(o.text??"")}]};case"mission_doc_restored":return{...i,entries:[...i.entries,{id:++He,ts:u,agent:"system",kind:"system",title:"mission doc restored",body:String(o.text??"")}]};case"git_branch":case"git_note":case"git_committed":case"run_note":return{...i,entries:[...i.entries,{id:++He,ts:u,agent:"system",kind:c.event==="git_committed"&&o.error||c.event==="git_note"?"error":"system",title:c.event==="git_branch"?`branch · ${String(o.branch??"")}`:c.event==="git_committed"?"branch closed":c.event==="run_note"?"note":"git",body:String(o.text??"")}]};case"budget_alert":return{...i,entries:[...i.entries,{id:++He,ts:u,agent:"system",kind:o.level==="exceeded"?"error":"system",title:"budget",body:o.text}]};case"service_exposed":return{...i,services:[...i.services.filter(d=>d.port!==o.port),{port:o.port,label:o.label,path:o.path,url:o.url,since:u}]};case"worker_started":{const d=i.agents.filter(m=>m.id!==o.id),h=i.agents.find(m=>m.id===o.id);return{...i,agents:[...d,{id:o.id,status:"running",task:o.task??h?.task}],entries:[...i.entries,{id:++He,ts:u,agent:o.id,kind:"system",title:o.resumed?"resumed":"spawned",body:o.task??""}]}}case"worker_progress":{const d=String(o.status??""),h=[d,...Array.isArray(o.done)&&o.done.length?[`done: ${o.done.join(", ")}`]:[],...o.next?[`next: ${String(o.next)}`]:[],...o.blocked?[`BLOCKED: ${String(o.blocked)}`]:[]].join(`
|
|
13
|
+
`);return{...i,agents:i.agents.map(m=>m.id===o.id?{...m,task:d||m.task}:m),entries:[...i.entries,{id:++He,ts:u,agent:String(o.id??"worker"),kind:"system",title:o.blocked?"progress · blocked":"progress",body:h}]}}case"worker_finished":return{...i,agents:i.agents.map(d=>d.id===o.id?{...d,status:o.status}:d)};case"permission_request":return i.approvals.some(d=>d.id===o.id)?i:{...i,approvals:[...i.approvals,{...o,since:u}],entries:[...i.entries,{id:++He,ts:u,agent:String(o.agent??"director"),kind:"system",title:"waiting on you",body:`${String(o.toolName??"tool")}: ${String(o.description??o.decisionReason??o.title??"needs your approval")}`}]};case"permission_resolved":{const d=i.approvals.find(h=>h.id===o.id);return d?{...i,approvals:i.approvals.filter(h=>h.id!==o.id),entries:[...i.entries,{id:++He,ts:u,agent:String(d.agent??"director"),kind:"system",title:"resolved",body:String(o.behavior??"resolved")}]}:i}case"question":return i.questions.some(d=>d.id===o.id)?i:{...i,questions:[...i.questions,{...o,since:u}],entries:[...i.entries,{id:++He,ts:u,agent:"director",kind:"system",title:"waiting on you",body:`question: ${String(o.question??"")}`}]};case"question_answered":return i.questions.find(h=>h.id===o.id)?{...i,questions:i.questions.filter(h=>h.id!==o.id),entries:[...i.entries,{id:++He,ts:u,agent:"director",kind:"system",title:"resolved",body:"answered"}]}:i;case"root_allowed":return{...i,entries:[...i.entries,{id:++He,ts:u,agent:String(o.agent??"director"),kind:"system",title:"path allowed for run",body:o.reason?`${String(o.path??"")} — ${String(o.reason)}`:String(o.path??"")}]};case"auto_denied":return{...i,entries:[...i.entries,{id:++He,ts:u,agent:String(o.agent??"director"),kind:"system",title:"redirected to workspace",body:String(o.reason??"")}]};case"permission_timeout":case"question_timeout":{const d=c.event==="permission_timeout";if(!(d?i.approvals.find(y=>y.id===o.id):i.questions.find(y=>y.id===o.id)))return i;const m=Math.max(1,Math.round(Number(o.afterMs??0)/6e4));return{...i,approvals:d?i.approvals.filter(y=>y.id!==o.id):i.approvals,questions:d?i.questions:i.questions.filter(y=>y.id!==o.id),entries:[...i.entries,{id:++He,ts:u,agent:String(o.agent??"director"),kind:"error",title:d?"auto-denied (unattended)":"auto-answered (unattended)",body:d?`${String(o.toolName??"tool")} waited ${m} min with no answer and was denied; the agent was told to redo the work inside .foreman/work/.`:`The director's question waited ${m} min with no answer; it was told to decide itself and record the decision in MISSION.md.`}]}}default:return i}}function Ug(i,c){switch(c.t){case"reset":return au;case"wire":return Ng(i,c.e);case"missiondoc":return{...i,missionDoc:c.doc}}}function Hg(i,c){const[u,o]=g.useReducer(Ug,au),d=g.useRef(null);return g.useEffect(()=>{if(o({t:"reset"}),!i)return;let h=!1;d.current=[];const m=c?Ol((p,S)=>{if(S.runId!==i)return;const b={event:p,data:S.data};d.current?d.current.push(b):o({t:"wire",e:b})}):null;(async()=>{try{const p=await fetch(`/runs/${encodeURIComponent(i)}/events`).catch(()=>null);if(h||!p?.ok)return;const{events:S}=await p.json();if(h)return;for(const b of S)o({t:"wire",e:b})}finally{if(!h){for(const p of d.current??[])o({t:"wire",e:p});d.current=null}}})();const y=async()=>{const p=await fetch(`/missiondoc?run=${encodeURIComponent(i)}`).catch(()=>null);p?.ok&&!h&&o({t:"missiondoc",doc:(await p.json()).doc})};y();const x=c?setInterval(y,5e3):null;return()=>{h=!0,m?.(),x&&clearInterval(x)}},[i,c]),u}function Bg(i,c){if(i==="message"){const u=c.msg;if(u?.type==="assistant")for(const o of u.message?.content??[]){if(o.type==="text"&&o.text?.trim())return`${c.agent}: ${o.text.trim()}`;if(o.type==="tool_use"){const d=String(o.name||"").replace(/^mcp__(foreman|playwright)__/,"");return`${c.agent} · ${d}`}}return null}return i==="worker_started"?`${c.id} ${c.resumed?"resumed":"spawned"}`:i==="worker_finished"?`${c.id} ${c.status}`:i==="worker_progress"?`${c.id}: ${c.blocked?`BLOCKED — ${c.blocked}`:c.status}`:i==="steer"?`you → ${c.to}: ${c.text}`:i==="budget_alert"?c.text:i==="question"?`director asks: ${c.question}`:null}function $g(){const[i,c]=g.useState([]),[u,o]=g.useState(!1),[d,h]=g.useState({mode:"none",source:""}),[m,y]=g.useState({}),[x,p]=g.useState(null),[S,b]=g.useState(""),[k,w]=g.useState(null),_=g.useCallback(async()=>{const X=await fetch("/projects").catch(()=>null);if(!X?.ok)return;const M=await X.json();c(M.projects),h({mode:M.authMode??"none",source:M.authSource??"",account:M.authAccount??void 0}),p(M.update?.latest?{latest:String(M.update.latest),current:String(M.version??"")}:null),b(String(M.version??"")),w(!!M.firstRun)},[]);return g.useEffect(()=>{_();const X=setInterval(_,3e3),M=Ol((R,N)=>{if(!N.chat&&(["run_started","run_resumed","run_finished","permission_request","permission_resolved","permission_timeout","question","question_answered","question_timeout"].includes(R)&&_(),N.projectId))if(R==="run_finished")y(Z=>{const{[N.projectId]:re,...B}=Z;return B});else{const Z=Bg(R,N.data);Z&&y(re=>({...re,[N.projectId]:Z.slice(0,160)}))}}),z=Rg(R=>{o(R),R&&_()});return()=>{clearInterval(X),M(),z()}},[_]),{projects:i,connected:u,auth:d,refresh:_,activity:m,update:x,version:S,firstRun:k}}function qg(i){const[c,u]=g.useState([]),o=g.useCallback(async()=>{const d=await fetch(`/runs?projectId=${encodeURIComponent(i)}`).catch(()=>null);d?.ok&&u((await d.json()).runs)},[i]);return g.useEffect(()=>(o(),Ol((h,m)=>{m.projectId===i&&(h==="run_started"||h==="run_resumed"||h==="run_finished"||h==="git_committed"||h==="pull_request")&&o()})),[i,o]),c}function Lg(i){const[c,u]=g.useState([]),[o,d]=g.useState({monthSpendUsd:0,monthlyCapUsd:0}),[h,m]=g.useState(!0),[y,x]=g.useState(""),p=g.useCallback(async()=>{if(!i){u([]),m(!1);return}const S=await Se.schedules(i).catch(()=>null);if(!S){x("could not reach the server"),m(!1);return}if(!S.ok){x((await S.json().catch(()=>({}))).error??`HTTP ${S.status}`),m(!1);return}const b=await S.json();u(b.schedules??[]),d({monthSpendUsd:b.monthSpendUsd??0,monthlyCapUsd:b.monthlyCapUsd??0}),x(""),m(!1)},[i]);return g.useEffect(()=>(m(!0),p(),Ol((b,k)=>{k.projectId===i&&(b==="schedule_paused"||b==="schedule_skipped"||b==="run_started"||b==="run_finished")&&p()})),[i,p]),{schedules:c,...o,loading:h,error:y,reload:p}}const Jc={entries:[],costUsd:0,proposal:null,thinking:!1,question:null,who:null};function Yg(i,c){return i.map(u=>`${u.question.replace(/[?:]\s*$/,"")} → ${c[u.question]||"(no answer)"}`).join(`
|
|
14
|
+
`)}function Xp(i,c){const u=c.ts??Date.now(),o=c.data;switch(c.event){case"chat_cleared":return Vp(i,{t:"reset"});case"chat_proposal_dismissed":return{...i,proposal:null};case"chat_message":return{...i,entries:[...i.entries,{id:++He,ts:u,agent:"you",kind:"steer",title:"you",body:o.text}]};case"message":{const d=Wp("foreman",o.msg,u).filter(h=>h.kind==="text"||h.kind==="tool"&&!/ask_user/.test(h.title));return d.length?{...i,entries:[...i.entries,...d]}:i}case"mission_proposed":return{...i,proposal:o};case"chat_cost":return{...i,costUsd:o.costUsd??i.costUsd};case"chat_turn":return{...i,thinking:o.state==="thinking",who:typeof o.model=="string"&&typeof o.provider=="string"?{model:o.model,provider:o.provider,costBasis:ga(o)}:i.who};case"chat_question":return Array.isArray(o.questions)&&o.questions.length?{...i,question:{id:String(o.id),questions:o.questions,askedAt:u}}:i;case"chat_answered":{const d=i.question,h=d&&d.id===o.id?d.questions:[],m=h.length?Yg(h,o.answers??{}):Object.entries(o.answers??{}).map(([y,x])=>`${y} → ${x}`).join(`
|
|
15
|
+
`);return{...i,question:i.question?.id===o.id?null:i.question,entries:m?[...i.entries,{id:++He,ts:u,agent:"you",kind:"steer",title:o.source?`you chose · via ${o.source}`:"you chose",body:m}]:i.entries}}case"chat_question_timeout":return{...i,question:i.question?.id===o.id?null:i.question,entries:[...i.entries,{id:++He,ts:u,agent:"system",kind:"error",title:"no answer (unattended)",body:`No answer after ${Math.round((o.afterMs??0)/6e4)} minutes — the planner is proceeding on its recommended options and will state the assumptions.`}]};case"chat_error":return{...i,entries:[...i.entries,{id:++He,ts:u,agent:"system",kind:"error",title:"planner",body:o.error}]};default:return i}}function Vp(i,c){switch(c.t){case"reset":return Jc;case"load":return c.view;case"dismiss":return{...i,proposal:null};case"wire":return Xp(i,c.e)}}function Gg(i){const[c,u]=g.useState([]),[o,d]=g.useState(!1);return g.useEffect(()=>{if(i.length<2){u([]),d(!1);return}let h=!1;d(!0);const m=setTimeout(()=>{fetch(`/search?q=${encodeURIComponent(i)}`).then(y=>y.ok?y.json():{runs:[]}).then(y=>{h||(u(y.runs??[]),d(!1))}).catch(()=>{h||(u([]),d(!1))})},200);return()=>{h=!0,clearTimeout(m)}},[i]),{hits:c,busy:o}}const Wg="_fleet";function Qp(i){const[c,u]=g.useReducer(Vp,Jc),o=g.useRef(null),d=g.useCallback(async S=>{const b=await fetch(`/chat?projectId=${encodeURIComponent(S)}`).catch(()=>null);return b?.ok?await b.json():null},[]);g.useEffect(()=>{if(u({t:"reset"}),!i)return;let S=!1;o.current=[];const b=Ol((k,w)=>{if(!w.chat||w.projectId!==i)return;const _={event:k,data:w.data};o.current?o.current.push(_):u({t:"wire",e:_})});return(async()=>{const k=await d(i);if(!S){if(k){let w={...Jc,costUsd:k.costUsd,proposal:k.proposal,thinking:k.thinking};for(const _ of k.events)w=Xp(w,_);w={...w,question:k.question??null,who:k.who??w.who,thinking:k.thinking},u({t:"load",view:w})}for(const w of o.current??[])u({t:"wire",e:w});o.current=null}})(),()=>{S=!0,b()}},[i,d]);const h=g.useCallback(async S=>{if(!i)return"no project";const b=await et("/chat",{projectId:i,text:S});return b.ok?null:(await b.json().catch(()=>({}))).error??"could not reach the planner"},[i]),m=g.useCallback(async()=>{i&&await et("/chat/stop",{projectId:i}).catch(()=>{})},[i]),y=g.useCallback(async()=>{i&&(await fetch(`/chat?projectId=${encodeURIComponent(i)}`,{method:"DELETE"}).catch(()=>{}),u({t:"reset"}))},[i]),x=g.useCallback(async(S,b)=>{if(!i)return"no project";const k=await et("/chat/answer",{projectId:i,id:S,answers:b});return k.ok?null:(await k.json().catch(()=>({}))).error??"could not deliver the answer"},[i]),p=g.useCallback(()=>u({t:"dismiss"}),[]);return{...c,send:h,answer:x,clear:y,stop:m,dismissProposal:p}}function Xg(){const[i,c]=g.useState(null),[u,o]=g.useState(!1),[d,h]=g.useState(""),m=g.useCallback(async()=>{const p=await fetch("/notify").catch(()=>null);p?.ok&&c(await p.json())},[]);g.useEffect(()=>{m()},[m]),g.useEffect(()=>{if(!i?.telegram.linking)return;const p=setInterval(()=>{m()},3e3);return()=>clearInterval(p)},[i?.telegram.linking,m]);const y=g.useCallback(async p=>{o(!0),h("");try{const S=await p();S.ok||h((await S.json().catch(()=>({}))).error??`HTTP ${S.status}`)}catch(S){h(S instanceof Error?S.message:String(S))}finally{o(!1),await m()}},[m]),x=(p,S,b)=>fetch(S,{method:p,headers:b?{"content-type":"application/json"}:void 0,body:b?JSON.stringify(b):void 0});return{status:i,busy:u,error:d,refresh:m,onSaveToken:p=>{y(()=>x("PUT","/notify/telegram/token",{token:p}))},onClearToken:()=>{y(()=>x("DELETE","/notify/telegram/token"))},onLink:()=>{y(()=>x("POST","/notify/telegram/link"))},onUnlink:()=>{y(()=>x("DELETE","/notify/telegram/link"))},onTest:()=>{y(()=>x("POST","/notify/test"))},onSavePublicUrl:p=>{y(()=>x("PATCH","/notify/settings",{publicUrl:p}))}}}function Vg(){const i=()=>{const h=window.location.hash.match(/^#\/p\/([^/]+)(?:\/r\/([^/]+)(?:\/(files|runs))?)?/);return{setup:/^#\/setup\b/.test(window.location.hash),projectId:h?decodeURIComponent(h[1]):null,runId:h?.[2]?decodeURIComponent(h[2]):null,tab:h?.[3]==="files"||h?.[3]==="runs"?h[3]:"mission"}},[c,u]=g.useState(i);g.useEffect(()=>{const h=()=>u(i());return window.addEventListener("hashchange",h),()=>window.removeEventListener("hashchange",h)},[]);const o=g.useCallback(h=>{window.location.hash=h?`#/p/${encodeURIComponent(h)}`:"#/"},[]),d=g.useCallback((h,m,y="mission")=>{window.location.hash=m?`#/p/${encodeURIComponent(h)}/r/${encodeURIComponent(m)}${y==="mission"?"":`/${y}`}`:`#/p/${encodeURIComponent(h)}`},[]);return{...c,go:o,goRun:d}}const et=(i,c)=>fetch(i,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(c)}),Se={linkProject:(i,c,u)=>et("/projects",{folder:i,name:c,provider:u}),cloneProject:(i,c)=>et("/projects/clone",{url:i,branch:c}),cloneStatus:i=>fetch(`/projects/clone/${encodeURIComponent(i)}`),cloneWhere:i=>fetch(`/projects/clone/where?url=${encodeURIComponent(i)}`),prDraft:i=>fetch(`/runs/${encodeURIComponent(i)}/pr`),openPr:(i,c,u)=>et(`/runs/${encodeURIComponent(i)}/pr`,{title:c,body:u}),prState:i=>fetch(`/runs/${encodeURIComponent(i)}/pr/state`),memory:i=>fetch(`/projects/${encodeURIComponent(i)}/memory`),runServices:i=>fetch(`/runs/${encodeURIComponent(i)}/services`),stopService:(i,c)=>et(`/runs/${encodeURIComponent(i)}/services/${c}/stop`,{}),instances:()=>fetch("/instances"),doctor:()=>fetch("/doctor"),setupDone:()=>et("/setup/done",{}),installBrowser:()=>et("/setup/browser",{}),browserInstall:i=>fetch(`/setup/browser/${encodeURIComponent(i)}`),updateProject:(i,c)=>fetch(`/projects/${encodeURIComponent(i)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(c)}),unlinkProject:i=>fetch(`/projects/${encodeURIComponent(i)}`,{method:"DELETE"}),run:(i,c,u,o={})=>et("/run",{projectId:i,mission:c,budgetUsd:u,directorModel:o.directorModel||void 0,workerModel:o.workerModel||void 0,directorProviderId:o.directorProviderId||void 0,workerProviderId:o.workerProviderId||void 0,browserTools:o.browserTools||void 0,allowDirty:o.allowDirty||void 0}),resume:(i,c={})=>et(`/runs/${encodeURIComponent(i)}/resume`,c),permission:(i,c,u)=>et("/permission",{id:i,behavior:c,message:u}),answer:(i,c)=>et("/answer",{id:i,text:c}),attach:async(i,c)=>{const u=await Promise.all(c.map(async o=>({name:o.name,type:o.type,data:await new Promise((d,h)=>{const m=new FileReader;m.onload=()=>d(String(m.result).split(",")[1]??""),m.onerror=()=>h(m.error),m.readAsDataURL(o)})})));return et("/attachments",{projectId:i,files:u})},forkPlan:(i,c)=>et("/chat/fork",{projectId:i,runId:c}),steer:(i,c)=>et("/steer",{runId:i,text:c}),interrupt:i=>et("/interrupt",{runId:i}),updateRun:(i,c)=>fetch("/run",{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({runId:i,...c})}).then(async u=>{if(!u.ok)throw new Error((await u.json().catch(()=>({}))).error||`HTTP ${u.status}`);return u.json()}),setProviderKey:(i,c)=>fetch(`/providers/${encodeURIComponent(i)}/key`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({key:c})}),clearProviderKey:i=>fetch(`/providers/${encodeURIComponent(i)}/key`,{method:"DELETE"}),schedules:i=>fetch(`/projects/${encodeURIComponent(i)}/schedules`),createSchedule:(i,c)=>et(`/projects/${encodeURIComponent(i)}/schedules`,c),updateSchedule:(i,c)=>fetch(`/schedules/${encodeURIComponent(i)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(c)}),deleteSchedule:i=>fetch(`/schedules/${encodeURIComponent(i)}`,{method:"DELETE"}),pauseSchedule:i=>et(`/schedules/${encodeURIComponent(i)}/pause`,{}),resumeSchedule:i=>et(`/schedules/${encodeURIComponent(i)}/resume`,{}),runScheduleNow:i=>et(`/schedules/${encodeURIComponent(i)}/run-now`,{}),previewCadence:i=>fetch(`/schedules/preview?cadence=${encodeURIComponent(JSON.stringify(i))}`),browse:i=>fetch("/browse"+(i?`?path=${encodeURIComponent(i)}`:"")),mkdir:(i,c)=>et("/mkdir",{parent:i,name:c}),locate:i=>fetch(`/locate?name=${encodeURIComponent(i)}`)};async function Kp(i,c,u){if(!u.length)return c;const o=await Se.attach(i,u),d=await o.json().catch(()=>({}));if(!o.ok)throw new Error(d.error||"could not save the attachments");const h=(d.files??[]).map(m=>m.path);return`${c}
|
|
16
|
+
|
|
17
|
+
Attached files (in the project folder — read them):
|
|
18
|
+
${h.map(m=>`- ${m}`).join(`
|
|
19
|
+
`)}`}function Zp(i){const[c,u]=g.useState(null),o=g.useCallback(()=>{Se.installBrowser().then(async d=>{if(!d.ok){u({id:"",state:"error",progress:"",error:`HTTP ${d.status}`});return}const{id:h}=await d.json();u({id:h,state:"running",progress:"Starting…"})})},[]);return g.useEffect(()=>{if(!c||c.state!=="running"||!c.id)return;const d=setInterval(async()=>{const h=await Se.browserInstall(c.id).catch(()=>null);if(!h?.ok)return;const m=await h.json();u({id:c.id,...m}),m.state!=="running"&&(clearInterval(d),m.state==="done"&&i?.())},1e3);return()=>clearInterval(d)},[c?.id,c?.state]),{start:o,job:c?{state:c.state,progress:c.progress,error:c.error}:null}}const Fp=(...i)=>i.filter((c,u,o)=>!!c&&c.trim()!==""&&o.indexOf(c)===u).join(" ").trim();const Qg=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Kg=i=>i.replace(/^([A-Z])|[\s-_]+(\w)/g,(c,u,o)=>o?o.toUpperCase():u.toLowerCase());const ip=i=>{const c=Kg(i);return c.charAt(0).toUpperCase()+c.slice(1)};var Oc={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 Zg=i=>{for(const c in i)if(c.startsWith("aria-")||c==="role"||c==="title")return!0;return!1},Fg=g.createContext({}),Jg=()=>g.useContext(Fg),Ig=g.forwardRef(({color:i,size:c,strokeWidth:u,absoluteStrokeWidth:o,className:d="",children:h,iconNode:m,...y},x)=>{const{size:p=24,strokeWidth:S=2,absoluteStrokeWidth:b=!1,color:k="currentColor",className:w=""}=Jg()??{},_=o??b?Number(u??S)*24/Number(c??p):u??S;return g.createElement("svg",{ref:x,...Oc,width:c??p??Oc.width,height:c??p??Oc.height,stroke:i??k,strokeWidth:_,className:Fp("lucide",w,d),...!h&&!Zg(y)&&{"aria-hidden":"true"},...y},[...m.map(([X,M])=>g.createElement(X,M)),...Array.isArray(h)?h:[h]])});const de=(i,c)=>{const u=g.forwardRef(({className:o,...d},h)=>g.createElement(Ig,{ref:h,iconNode:c,className:Fp(`lucide-${Qg(ip(i))}`,`lucide-${i}`,o),...d}));return u.displayName=ip(i),u};const Pg=[["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"}]],ey=de("activity",Pg);const ty=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],ny=de("arrow-left",ty);const ay=[["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"}]],ly=de("arrow-up-down",ay);const iy=[["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"}]],sy=de("bell",iy);const ry=[["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"}]],oy=de("bot",ry);const cy=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],uy=de("braces",cy);const dy=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],fy=de("bug",dy);const hy=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],py=de("check",hy);const vy=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],my=de("chevron-down",vy);const gy=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],yy=de("chevron-left",gy);const xy=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],by=de("chevron-right",xy);const jy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Sy=de("circle",jy);const ky=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],wy=de("clock",ky);const zy=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Cy=de("code",zy);const Ty=[["path",{d:"M13.744 17.736a6 6 0 1 1-7.48-7.48",key:"bq4yh3"}],["path",{d:"M15 6h1v4",key:"11y1tn"}],["path",{d:"m6.134 14.768.866-.5 2 3.464",key:"17snzx"}],["circle",{cx:"16",cy:"8",r:"6",key:"14bfc9"}]],My=de("coins",Ty);const Ey=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],_y=de("corner-down-left",Ey);const Dy=[["path",{d:"M14 9 9 4 4 9",key:"1af5af"}],["path",{d:"M20 20h-7a4 4 0 0 1-4-4V4",key:"1blwi3"}]],Ay=de("corner-left-up",Dy);const Ry=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],Oy=de("cpu",Ry);const Ny=[["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"}]],Uy=de("eye",Ny);const Hy=[["path",{d:"M14.364 13.634a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506l4.013-4.009a1 1 0 0 0-3.004-3.004z",key:"ukzhwg"}],["path",{d:"M14.487 7.858A1 1 0 0 1 14 7V2",key:"1klhew"}],["path",{d:"M20 19.645V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l2.516 2.516",key:"rxaxab"}],["path",{d:"M8 18h1",key:"13wk12"}]],By=de("file-pen-line",Hy);const $y=[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],qy=de("file-pen",$y);const Ly=[["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"}]],Yy=de("file-text",Ly);const Gy=[["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"}]],Wy=de("file",Gy);const Xy=[["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"}]],Vy=de("folder-open",Xy);const Qy=[["path",{d:"M10.7 20H4a2 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.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]],Ky=de("folder-search",Qy);const Zy=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Fy=de("folder",Zy);const Jy=[["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"}]],Iy=de("funnel",Jy);const Py=[["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"}]],ex=de("globe",Py);const tx=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],nx=de("image",tx);const ax=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]],lx=de("layout-template",ax);const ix=[["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"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],sx=de("list-checks",ix);const rx=[["path",{d:"M16 5H3",key:"m91uny"}],["path",{d:"M16 12H3",key:"1a2rj7"}],["path",{d:"M9 19H3",key:"s61nz1"}],["path",{d:"m16 16-3 3 3 3",key:"117b85"}],["path",{d:"M21 5v12a2 2 0 0 1-2 2h-6",key:"hey24a"}]],ox=de("list-end",rx);const cx=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ux=de("loader-circle",cx);const dx=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],fx=de("message-circle-question-mark",dx);const hx=[["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"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]],px=de("message-square-plus",hx);const vx=[["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"}]],mx=de("message-square",vx);const gx=[["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"}]],yx=de("moon",gx);const xx=[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],bx=de("octagon-alert",xx);const jx=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Sx=de("paperclip",jx);const kx=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],wx=de("pause",kx);const zx=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Cx=de("pen-line",zx);const Tx=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Mx=de("plus",Tx);const Ex=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],_x=de("power",Ex);const Dx=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],Ax=de("quote",Dx);const Rx=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Ox=de("rotate-ccw-clock",Rx);const Nx=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Ux=de("rotate-cw",Nx);const Hx=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Bx=de("save",Hx);const $x=[["path",{d:"m8 11 2 2 4-4",key:"1sed1v"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],qx=de("search-check",$x);const Lx=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Yx=de("search",Lx);const Gx=[["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"}]],Wx=de("send-horizontal",Gx);const Xx=[["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"}]],Vx=de("server",Xx);const Qx=[["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"}]],Kx=de("settings",Qx);const Zx=[["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"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Fx=de("shield-check",Zx);const Jx=[["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22",key:"1ailkh"}],["path",{d:"M2 6h1.972a4 4 0 0 1 3.6 2.2",key:"km57vx"}],["path",{d:"M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45",key:"os18l9"}]],Ix=de("shuffle",Jx);const Px=[["path",{d:"m10 9-3 3 3 3",key:"1oro0q"}],["path",{d:"m14 15 3-3-3-3",key:"bz13h7"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],e0=de("square-code",Px);const t0=[["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"}]],n0=de("sun",t0);const a0=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],l0=de("terminal",a0);const i0=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],s0=de("text-align-start",i0);const r0=[["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"}]],o0=de("triangle-alert",r0);const c0=[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]],u0=de("unlink",c0);const d0=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],f0=de("user-plus",d0);const h0=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],p0=de("user",h0);const v0=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],m0=de("users",v0);const g0=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],y0=de("wifi-off",g0);const x0=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],b0=de("wrench",x0);const j0=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],S0=de("x",j0);const k0=[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]],w0=de("zap",k0),sp={Circle:Sy,Activity:ey,Check:py,X:S0,Pause:wx,WifiOff:y0,History:Ox,TriangleAlert:o0,OctagonAlert:bx,RotateCw:Ux,Bot:oy,Plus:Mx,CornerLeftUp:Ay,ArrowLeft:ny,Folder:Fy,Bell:sy,Unlink:u0,Sun:n0,Moon:yx,Clock:wy,AlignLeft:s0,Users:m0,ChevronDown:my,ChevronRight:by,ChevronLeft:yy,Braces:uy,MessageCircleQuestion:fx,ShieldCheck:Fx,Coins:My,LayoutTemplate:lx,Save:Bx,Filter:Iy,Settings:Kx,Paperclip:Sx,File:Wy,Image:nx,Code:Cy,SquareCode:e0,Quote:Ax,PenLine:Cx,Eye:Uy,Cpu:Oy,LoaderCircle:ux,MessageSquarePlus:px,SendHorizontal:Wx,User:p0,Zap:w0,ListEnd:ox,FilePen:qy,FilePenLine:By,FileText:Yy,Terminal:l0,Search:Yx,FolderSearch:Ky,FolderOpen:Vy,Globe:ex,ListChecks:sx,UserPlus:f0,MessageSquare:mx,CornerDownLeft:_y,Power:_x,Wrench:b0,Bug:fy,Shuffle:Ix,SearchCheck:qx,ArrowUpDown:ly,Server:Vx},rp={idle:"Circle",running:"Activity",done:"Check",error:"X",interrupted:"Pause",disconnected:"WifiOff",readonly:"History",warning:"TriangleAlert",critical:"OctagonAlert",caution:"TriangleAlert",resume:"RotateCw",orchestration:"Bot",add:"Plus",parent:"CornerLeftUp",back:"ArrowLeft",folder:"Folder",needsYou:"Bell",unlink:"Unlink",sun:"Sun",moon:"Moon",provider:"Server",search:"Search",sort:"ArrowUpDown",timeline:"Clock",transcript:"AlignLeft",crew:"Users",chevronDown:"ChevronDown",chevronRight:"ChevronRight",chevronLeft:"ChevronLeft",raw:"Braces",question:"MessageCircleQuestion",approval:"ShieldCheck",check:"Check",close:"X",budget:"Coins",template:"LayoutTemplate",draft:"Save",filter:"Filter",settings:"Settings",attach:"Paperclip",file:"File",image:"Image",code:"Code",codeBlock:"SquareCode",quote:"Quote",write:"PenLine",preview:"Eye",model:"Cpu",loading:"LoaderCircle",steer:"MessageSquarePlus",send:"SendHorizontal",you:"User",now:"Zap",nextTurn:"ListEnd",Write:"FilePen",Edit:"FilePenLine",MultiEdit:"FilePenLine",Read:"FileText",Bash:"Terminal",Grep:"Search",Glob:"FolderSearch",LS:"FolderOpen",WebFetch:"Globe",WebSearch:"Globe",Task:"ListChecks",TodoWrite:"ListChecks",spawn_worker:"UserPlus",message_worker:"MessageSquare",ask_human:"MessageCircleQuestion",result:"CornerDownLeft",init:"Power",tool:"Wrench",Bug:"Bug",Shuffle:"Shuffle",SearchCheck:"SearchCheck"};function ie({name:i,size:c=16,strokeWidth:u=1.75,color:o,label:d,style:h}){const m=rp[i]||i,y=sp[m]||sp[rp.tool];return l.jsx(y,{width:c,height:c,strokeWidth:u,color:o||"currentColor","aria-hidden":d?void 0:!0,"aria-label":d,role:d?"img":void 0,style:{flex:"0 0 auto",display:"block",...h}})}const op={idle:{color:"var(--ink-2)",icon:"idle",label:"idle"},running:{color:"var(--status-good)",icon:"running",label:"running"},done:{color:"var(--status-good)",icon:"done",label:"done"},error:{color:"var(--status-critical)",icon:"error",label:"error"},interrupted:{color:"var(--status-serious)",icon:"interrupted",label:"interrupted"},"needs-you":{color:"var(--status-warning)",icon:"needsYou",label:"needs you"}};function ya({status:i,style:c}){const u=op[i]??op.idle;return l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:"var(--fs-sm)",color:"var(--ink-1)",padding:"2px 8px 2px 6px",borderRadius:"var(--r-pill)",background:"var(--bg-inset)",border:"1px solid var(--line)",whiteSpace:"nowrap",lineHeight:"16px",...c},children:[l.jsx(ie,{name:u.icon,size:12,strokeWidth:2.25,color:u.color}),u.label]})}function z0({value:i,onChange:c,groups:u=[],placeholder:o="Search projects and runs…",busy:d=!1,style:h}){const m=g.useRef(null),[y,x]=g.useState(!1),[p,S]=g.useState(0),b=i.trim().length>0,k=u.flatMap(z=>z.items),w=y&&b&&(k.length>0||!d);g.useEffect(()=>{const z=R=>{const N=document.activeElement,Z=N&&(N.tagName==="INPUT"||N.tagName==="TEXTAREA"||N.isContentEditable),re=R.key==="/"&&!Z&&!R.metaKey&&!R.ctrlKey&&!R.altKey,B=R.key.toLowerCase()==="k"&&(R.metaKey||R.ctrlKey)&&!R.altKey;(re||B)&&(R.preventDefault(),m.current?.focus(),m.current?.select())};return window.addEventListener("keydown",z),()=>window.removeEventListener("keydown",z)},[]),g.useEffect(()=>{S(0)},[i,k.length]);const _=z=>{z.onPick?.(),c?.(""),m.current?.blur()},X=z=>{if(z.key==="Escape"){i?c?.(""):z.currentTarget.blur();return}!w||!k.length||(z.key==="ArrowDown"?(z.preventDefault(),S(R=>(R+1)%k.length)):z.key==="ArrowUp"?(z.preventDefault(),S(R=>(R-1+k.length)%k.length)):z.key==="Enter"&&(z.preventDefault(),_(k[p]??k[0])))};let M=-1;return l.jsxs("div",{style:{position:"relative",flex:"0 1 26rem",minWidth:"12rem",...h},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",background:"var(--bg-card)",borderRadius:"var(--r-sm)",border:`1px solid ${y?"var(--brand)":"var(--line)"}`,padding:"4px var(--sp-2)",transition:"border-color var(--dur-fast) var(--ease)"},children:[l.jsx(ie,{name:"search",size:14,color:"var(--ink-2)"}),l.jsx("input",{ref:m,value:i,type:"text",placeholder:o,"aria-label":"Search projects, runs and actions",role:"combobox","aria-expanded":w,onChange:z=>c?.(z.target.value),onFocus:()=>x(!0),onBlur:()=>setTimeout(()=>x(!1),120),onKeyDown:X,style:{flex:1,minWidth:0,border:"none",outline:"none",background:"transparent",color:"var(--ink-0)",font:"inherit",fontSize:"var(--fs-sm)",padding:0,boxShadow:"none"}}),b?l.jsx("button",{type:"button",onClick:()=>{c?.(""),m.current?.focus()},title:"Clear (Esc)","aria-label":"Clear search",style:{display:"inline-flex",background:"none",border:"none",padding:0,cursor:"pointer",color:"var(--ink-2)"},children:l.jsx(ie,{name:"close",size:13})}):l.jsx("kbd",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",border:"1px solid var(--line)",borderRadius:3,padding:"0 4px",lineHeight:"15px",whiteSpace:"nowrap"},children:"⌘K"})]}),w&&l.jsxs("div",{role:"listbox",style:{position:"absolute",top:"calc(100% + 6px)",left:0,width:"max(100%, 34rem)",maxWidth:"calc(100vw - 2rem)",maxHeight:"60vh",overflowY:"auto",zIndex:30,background:"var(--bg-panel)",border:"1px solid var(--line-strong)",borderRadius:"var(--r-md)",boxShadow:"0 12px 32px rgba(0,0,0,.35)",padding:"var(--sp-1) 0"},children:[k.length===0&&l.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-3)",fontSize:"var(--fs-sm)",color:"var(--ink-2)"},children:["Nothing matches “",i.trim(),"”."]}),u.filter(z=>z.items.length).map(z=>l.jsxs("div",{children:[l.jsxs("div",{style:{padding:"6px var(--sp-3) 2px",fontSize:"var(--fs-xs)",color:"var(--ink-2)",letterSpacing:".06em",textTransform:"uppercase"},children:[z.label,z.count!==void 0?` · ${z.count}`:""]}),z.items.map(R=>{M+=1;const N=M,Z=N===p;return l.jsxs("button",{type:"button",role:"option","aria-selected":Z,onMouseDown:re=>re.preventDefault(),onMouseEnter:()=>S(N),onClick:()=>_(R),style:{display:"grid",gridTemplateColumns:"auto minmax(0, 1fr) auto",alignItems:"center",gap:"var(--sp-2)",width:"100%",textAlign:"left",padding:"6px var(--sp-3)",border:"none",font:"inherit",background:Z?"var(--bg-hover)":"transparent",color:"var(--ink-0)",cursor:"pointer"},children:[l.jsx(ie,{name:R.icon??"folder",size:14,color:"var(--ink-2)"}),l.jsxs("span",{style:{minWidth:0,display:"flex",flexDirection:"column"},children:[l.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--fs-sm)"},children:R.title}),R.detail&&l.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:R.detail})]}),l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"var(--sp-2)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums"},children:[R.status&&l.jsx(ya,{status:R.status}),R.meta]})]},R.id)})]},z.label))]})]})}const cp={"api-key":{color:"var(--status-warning)",icon:"budget",label:"API key billing",hint:"Missions bill a metered API key, not a Claude subscription. Usage is charged per token."},subscription:{color:"var(--ink-2)",icon:"budget",label:"subscription",hint:"Missions run on the signed-in Claude subscription."},cloud:{color:"var(--ink-2)",icon:"budget",label:"cloud provider",hint:"Missions bill a cloud provider (Bedrock/Vertex)."},local:{color:"var(--ink-2)",icon:"model",label:"local model",hint:"Missions run on a model served from this machine. No per-token cost, so budgets are capped by turns and time."},provider:{color:"var(--status-warning)",icon:"budget",label:"external provider",hint:"Missions bill an endpoint Foreman does not price. Spend is real but its dollar figure is not shown."},none:{color:"var(--status-critical)",icon:"error",label:"no credentials",hint:"No credentials found — missions cannot run."}};function Jp({mode:i,source:c,account:u,compact:o,style:d}){const h=cp[i]??cp.none,m=u?.email,y=h.label,x=[h.hint,m&&u.org?`Account: ${m} (${u.org})`:m&&`Account: ${m}`,c&&`Source: ${c}`].filter(Boolean).join(`
|
|
20
|
+
`),p=i==="api-key"||i==="none"||i==="provider";return l.jsxs("span",{title:x,style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:o?"var(--fs-xs)":"var(--fs-sm)",color:"var(--ink-1)",padding:o?"1px 6px 1px 5px":"2px 8px 2px 6px",borderRadius:"var(--r-pill)",background:"var(--bg-inset)",border:`1px solid ${p?h.color:"var(--line)"}`,whiteSpace:"nowrap",lineHeight:"16px",...d},children:[l.jsx(ie,{name:h.icon,size:12,strokeWidth:2.25,color:h.color}),o?y:`billing: ${y}`]})}function Ui({children:i,title:c,onClick:u,tone:o}){const d=o==="warn"?"var(--status-warning)":o==="bad"?"var(--status-error)":"var(--ink-2)",h=l.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:6,color:d,whiteSpace:"nowrap",minWidth:0},children:i});return u?l.jsx("button",{type:"button",onClick:u,title:c,style:{background:"none",border:0,padding:"0 2px",margin:"0 -2px",font:"inherit",cursor:"pointer",display:"inline-flex",minWidth:0,borderRadius:3},children:h}):l.jsx("span",{title:c,style:{display:"inline-flex",minWidth:0},children:h})}const C0=({color:i})=>l.jsx("span",{"aria-hidden":!0,style:{width:7,height:7,borderRadius:"50%",background:i,flex:"0 0 auto"}}),rr=()=>l.jsx("span",{"aria-hidden":!0,style:{width:1,height:12,background:"var(--line)",margin:"0 var(--sp-2)",flex:"0 0 auto"}}),or=i=>String(i??"").replace(/^https?:\/\//,"").replace(/\/+$/,"");function T0({connected:i,localUrl:c,publicUrl:u,phone:o,auth:d,version:h,update:m,onOpenSettings:y,style:x}){const p=typeof u=="string"&&u.startsWith("https://"),S=u&&or(u)!==or(c)?u:null;return l.jsxs("footer",{style:{display:"flex",alignItems:"center",gap:0,flex:"0 0 auto",minHeight:24,padding:"2px var(--sp-4)",background:"var(--bg-panel)",borderTop:"1px solid var(--line)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontVariantNumeric:"tabular-nums",overflow:"hidden",...x},children:[l.jsxs(Ui,{title:i?"Live: this tab follows the server’s event stream":"Disconnected: the tab lost the server’s event stream and is reconnecting",tone:i?void 0:"bad",children:[l.jsx(C0,{color:i?"var(--status-success)":"var(--status-error)"}),i?"connected":"disconnected"]}),l.jsx(rr,{}),l.jsxs(Ui,{title:`Serving on ${c}${S?` and, on your tailnet, ${S}${p?" (HTTPS via tailscale serve)":" (plain HTTP — foreman doctor shows the one command for HTTPS)"}`:""}`,children:[l.jsx("span",{style:{fontFamily:"var(--font-mono)",overflow:"hidden",textOverflow:"ellipsis"},children:or(c)}),S&&l.jsxs(l.Fragment,{children:[l.jsx("span",{"aria-hidden":!0,children:"·"}),l.jsx(ie,{name:p?"approval":"provider",size:12,color:p?"var(--status-success)":"var(--ink-2)"}),l.jsx("span",{style:{fontFamily:"var(--font-mono)",overflow:"hidden",textOverflow:"ellipsis"},children:or(S)})]})]}),o!==void 0&&l.jsxs(l.Fragment,{children:[l.jsx(rr,{}),l.jsxs(Ui,{onClick:()=>y?.("notifications"),title:o?`Telegram linked to ${o}. Approvals, questions and the front desk reach that chat. Click for Notifications.`:"No phone linked. Settings → Notifications links a Telegram chat: approvals, questions and the front desk on the move.",children:[l.jsx(ie,{name:"needsYou",size:12}),o?`phone ${o}`:"no phone linked"]})]}),l.jsxs("span",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",minWidth:0},children:[d&&l.jsxs(l.Fragment,{children:[l.jsx(Ui,{onClick:()=>y?.("provider"),title:"Who pays for missions by default. Click for Provider.",children:l.jsx(Jp,{mode:d.mode,source:d.source,account:d.account,compact:!0})}),l.jsx(rr,{})]}),m&&l.jsxs(l.Fragment,{children:[l.jsxs(Ui,{tone:"warn",title:`You run ${m.current}; ${m.latest} is on npm. In a terminal: foreman update — it refuses while a mission is live.`,children:[m.latest," available · ",l.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:"foreman update"})]}),l.jsx(rr,{})]}),h&&l.jsxs("a",{href:"https://github.com/amenophis1er/foreman/releases",target:"_blank",rel:"noopener noreferrer",title:`Foreman ${h} — release notes`,style:{fontFamily:"var(--font-mono)",color:"var(--ink-2)",textDecoration:"none",whiteSpace:"nowrap"},children:["v",h]})]})]})}const M0=/\.(png|jpe?g|gif|webp|svg|heic)$/i,E0=/\.(js|jsx|ts|tsx|py|rb|go|rs|java|kt|swift|c|cc|cpp|h|css|html|json|ya?ml|toml|sh|sql|md)$/i;function _0(i){return i==null?"":i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(i<10240?1:0)} KB`:`${(i/1048576).toFixed(1)} MB`}function Ip({name:i,size:c,onRemove:u,style:o}){const[d,h]=g.useState(!1),m=M0.test(i)?"image":E0.test(i)?"code":"file";return l.jsxs("span",{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{display:"inline-flex",alignItems:"center",gap:6,maxWidth:260,height:24,padding:"0 4px 0 8px",background:"var(--bg-inset)",border:`1px solid ${d?"var(--line-strong)":"var(--line)"}`,borderRadius:"var(--r-sm)",fontSize:"var(--fs-sm)",color:"var(--ink-0)",...o},children:[l.jsx(ie,{name:m,size:13,color:"var(--ink-2)"}),l.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i}),c!=null&&l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",whiteSpace:"nowrap"},children:_0(c)}),u&&l.jsx("button",{type:"button",onClick:u,"aria-label":`Remove ${i}`,style:{display:"inline-flex",width:18,height:18,alignItems:"center",justifyContent:"center",background:"none",border:"none",borderRadius:3,padding:0,cursor:"pointer",color:"var(--ink-2)"},children:l.jsx(ie,{name:"close",size:12})})]})}const D0={default:{background:"var(--bg-card)",border:"1px solid var(--line-strong)",color:"var(--ink-0)"},primary:{background:"var(--brand)",border:"1px solid var(--brand)",color:"var(--brand-ink)",fontWeight:"var(--fw-semibold)"},good:{background:"transparent",border:"1px solid var(--status-good)",color:"var(--ink-0)"},danger:{background:"transparent",border:"1px solid var(--status-critical)",color:"var(--ink-0)"},ghost:{background:"none",border:"1px solid transparent",color:"var(--ink-1)"}},A0={default:{borderColor:"var(--ink-2)"},primary:{filter:"brightness(1.08)"},good:{background:"color-mix(in srgb, var(--status-good) 14%, transparent)"},danger:{background:"color-mix(in srgb, var(--status-critical) 14%, transparent)"},ghost:{color:"var(--ink-0)",background:"var(--bg-hover)"}},R0={default:{background:"var(--bg-inset)"},primary:{filter:"brightness(0.94)"},good:{background:"color-mix(in srgb, var(--status-good) 22%, transparent)"},danger:{background:"color-mix(in srgb, var(--status-critical) 22%, transparent)"},ghost:{background:"var(--bg-inset)"}},up={sm:{padding:"3px 8px",fontSize:"var(--fs-sm)",gap:5,icon:13},md:{padding:"6px 12px",fontSize:"var(--fs-md)",gap:6,icon:15}};function le({children:i,onClick:c,variant:u="default",size:o="md",icon:d,disabled:h,title:m,type:y="button",style:x}){const[p,S]=g.useState(!1),[b,k]=g.useState(!1),w=up[o]||up.md;return l.jsxs("button",{type:y,title:m,disabled:h,onClick:c,onMouseEnter:()=>S(!0),onMouseLeave:()=>{S(!1),k(!1)},onMouseDown:()=>k(!0),onMouseUp:()=>k(!1),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:w.gap,padding:w.padding,borderRadius:"var(--r-sm)",fontSize:w.fontSize,lineHeight:"var(--lh)",whiteSpace:"nowrap",cursor:h?"default":"pointer",transition:"background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), filter var(--dur-fast) var(--ease)",...D0[u],...h?{opacity:.5}:p?A0[u]:null,...!h&&b?R0[u]:null,...x},children:[d&&l.jsx(ie,{name:d,size:w.icon}),i]})}const Nc=i=>`${i.name}:${i.size}`,lu=22,dp=lu*3,fp=lu*10;function Ic({value:i,onChange:c,onSend:u,onStop:o,busy:d,disabled:h,disabledReason:m,placeholder:y,who:x,onChangeModel:p,autoFocus:S,style:b,hint:k,busyHint:w,attach:_=!0}){const[X,M]=g.useState(""),[z,R]=g.useState(!1),[N,Z]=g.useState([]),[re,B]=g.useState(!1),L=g.useRef(null),P=g.useRef(null),G=se=>{if(!_)return;const me=Array.from(se||[]);me.length&&Z(j=>{const q=new Set(j.map(Nc));return[...j,...me.filter(O=>!q.has(Nc(O)))]})},ce=i??X,te=c??M,ee=!h&&!d&&(ce.trim().length>0||N.length>0);g.useEffect(()=>{const se=L.current;se&&(se.style.height="auto",se.style.height=Math.max(dp,Math.min(se.scrollHeight,fp))+"px")},[ce]);const xe=()=>{ee&&(u?.(ce.trim()||(N.length?"See the attached files.":""),N),te(""),Z([]))};return l.jsxs("div",{style:{flex:"0 0 auto",background:re?"var(--brand-wash)":"var(--bg-card)",border:`1px solid ${z||re?"var(--brand)":"var(--line-strong)"}`,borderRadius:"var(--r-md)",padding:"var(--sp-2) var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-2)",opacity:h?.6:1,transition:"border-color var(--dur-fast) var(--ease)",...b},onDragOver:se=>{h||(se.preventDefault(),B(!0))},onDragLeave:se=>{se.target===se.currentTarget&&B(!1)},onDrop:se=>{se.preventDefault(),B(!1),h||G(se.dataTransfer.files)},children:[l.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",alignItems:"flex-start"},children:[l.jsx("span",{className:d?"pulse":void 0,style:{marginTop:3,flex:"0 0 auto",display:"inline-flex"},children:l.jsx(ie,{name:d?"loading":"steer",size:15,color:"var(--brand)"})}),l.jsx("textarea",{ref:L,rows:3,value:ce,disabled:h,autoFocus:S,placeholder:h?m||"Not available right now.":y||"Ask, think out loud, or describe what you want built…",onChange:se=>te(se.target.value),onPaste:se=>{se.clipboardData?.files?.length&&(se.preventDefault(),G(se.clipboardData.files))},onFocus:()=>R(!0),onBlur:()=>R(!1),onKeyDown:se=>{(se.metaKey||se.ctrlKey)&&se.key==="Enter"&&(se.preventDefault(),xe())},style:{flex:1,minWidth:0,resize:"none",border:"none",outline:"none",boxShadow:"none",background:"transparent",borderRadius:"var(--r-sm)",color:"var(--ink-0)",font:"inherit",lineHeight:`${lu}px`,padding:"2px 0",minHeight:dp,maxHeight:fp}})]}),N.length>0&&l.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:N.map((se,me)=>l.jsx(Ip,{name:se.name,size:se.size,onRemove:()=>Z(j=>j.filter((q,O)=>O!==me))},Nc(se)))}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[l.jsxs("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:x?`${x.model} via ${x.provider}`:void 0,children:[x&&l.jsxs("span",{style:{fontFamily:"var(--font-mono)",color:"var(--ink-1)"},role:p?"button":void 0,onClick:p,title:p?"Change the planner model in Settings → Models":void 0,...p?{style:{fontFamily:"var(--font-mono)",color:"var(--ink-1)",cursor:"pointer",textDecoration:"underline dotted",textUnderlineOffset:3}}:{},children:[x.model," · ",x.provider.split(" · ")[0],x.costBasis==="free"?" · free":x.costBasis==="unpriced"?" · unpriced":""," — "]}),d?w??"The foreman is looking…":k??"Reads the project, never changes it."]}),l.jsx("span",{style:{marginLeft:"auto"}}),_&&l.jsx("input",{ref:P,type:"file",multiple:!0,style:{display:"none"},onChange:se=>{G(se.target.files),se.target.value=""}}),_&&l.jsx(le,{size:"sm",variant:"ghost",icon:"attach",disabled:h,title:"Attach files — or drop them here, or paste an image",onClick:()=>P.current?.click(),children:"Attach"}),d&&o?l.jsx(le,{size:"sm",variant:"danger",icon:"close",onClick:o,title:"Stop the planner and discard the rest of this reply",children:"Stop"}):l.jsx(le,{size:"sm",icon:"send",onClick:xe,disabled:!ee,title:"⌘↵",children:"Send"})]})]})}function iu({children:i,accent:c,tone:u="card",style:o,onClick:d,title:h}){const m=u==="panel"?"var(--bg-panel)":u==="inset"?"var(--bg-inset)":"var(--bg-card)";return l.jsx("div",{onClick:d,title:h,role:d?"button":void 0,style:{background:m,border:"1px solid var(--line)",borderLeft:c?`var(--accent-w) solid ${c}`:"1px solid var(--line)",borderRadius:"var(--r-sm)",padding:"var(--sp-3)",cursor:d?"pointer":void 0,...o},children:i})}function vr(i){if(i==="director")return"var(--brand)";if(i==="you")return"var(--ink-0)";const c=/(\d+)/.exec(String(i||""));return`var(--agent-worker-${c?(parseInt(c[1],10)-1)%6+1:1})`}function mn({agent:i,size:c="md",style:u}){const o=c==="sm"?"var(--dot-sm)":"var(--dot)";return l.jsx("span",{"aria-hidden":!0,style:{width:o,height:o,borderRadius:"var(--r-pill)",background:vr(i),flex:"0 0 auto",...u}})}function Pp(i){if(i==null)return null;if(typeof i=="object")return i;try{return JSON.parse(i)}catch{return null}}function hp(i){if(!i)return"";const c=String(i).split("/");return c.length>3?"…/"+c.slice(-3).join("/"):i}function ev(i,c){if(!c)return"";switch(i){case"Write":case"Edit":case"MultiEdit":case"Read":return hp(c.file_path||c.path);case"Bash":return c.command||"";case"Grep":return`${c.pattern??""}${c.path?" in "+hp(c.path):""}`;case"Glob":return c.pattern||"";case"WebFetch":case"WebSearch":return c.url||c.query||"";case"spawn_worker":return`${c.id??"worker"} — ${(c.task||"").slice(0,80)}`;case"message_worker":return`${c.id??"worker"} — ${(c.message||"").slice(0,80)}`;case"ask_human":return c.question||"";default:{const u=Object.keys(c)[0];return u?`${u}: ${String(c[u]).slice(0,80)}`:""}}}function Uc({text:i,tone:c,max:u=12}){const o=String(i??"").split(`
|
|
21
|
+
`),d=o.slice(0,u),h=c==="add"?"var(--diff-add-bg)":c==="del"?"var(--diff-del-bg)":"transparent",m=c==="add"?"+":c==="del"?"−":" ";return l.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",lineHeight:1.5},children:[d.map((y,x)=>l.jsxs("div",{style:{display:"flex",background:h,padding:"0 8px"},children:[l.jsx("span",{style:{width:14,flex:"0 0 auto",color:c==="add"?"var(--status-good)":c==="del"?"var(--status-critical)":"var(--ink-2)"},children:m}),l.jsx("span",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word",color:"var(--ink-0)"},children:y})]},x)),o.length>u&&l.jsxs("div",{style:{padding:"2px 8px",color:"var(--ink-2)"},children:["… ",o.length-u," more lines"]})]})}function O0({tool:i,input:c}){if(!c)return null;if(i==="Write")return l.jsx(Uc,{text:c.content,tone:"add"});const u=i==="MultiEdit"?c.edits||[]:[c];return l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:u.map((o,d)=>l.jsxs("div",{children:[l.jsx(Uc,{text:o.old_string,tone:"del",max:8}),l.jsx(Uc,{text:o.new_string,tone:"add",max:8})]},d))})}const N0=new Set(["spawn_worker","message_worker","ask_human"]);function tv({tool:i="tool",input:c,body:u,defaultOpen:o=!1,style:d}){const h=c??Pp(u),[m,y]=g.useState(o),[x,p]=g.useState(!1),S=N0.has(i),b=h&&(i==="Write"||i==="Edit"||i==="MultiEdit"),k=ev(i,h)||(typeof u=="string"?u.slice(0,120):"");return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,...d},children:[l.jsxs("button",{type:"button",onClick:()=>y(!m),title:m?"Collapse":"Expand",style:{display:"flex",alignItems:"center",gap:8,padding:0,background:"none",border:"none",cursor:"pointer",color:"var(--ink-0)",textAlign:"left",width:"100%",font:"inherit"},children:[l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,padding:"2px 8px 2px 6px",borderRadius:"var(--r-pill)",background:S?"var(--brand-wash-strong)":"var(--bg-inset)",border:`1px solid ${S?"var(--brand)":"var(--line)"}`,color:S?"var(--brand)":"var(--ink-1)",fontSize:"var(--fs-xs)",fontWeight:"var(--fw-semibold)",fontFamily:"var(--font-mono)",whiteSpace:"nowrap",lineHeight:"16px"},children:[l.jsx(ie,{name:i,size:12,strokeWidth:2}),i]}),l.jsx("span",{style:{flex:1,minWidth:0,fontFamily:"var(--font-mono)",fontSize:"var(--fs-sm)",color:"var(--ink-1)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:k}),l.jsx(ie,{name:m?"chevronDown":"chevronRight",size:14,color:"var(--ink-2)"})]}),m&&l.jsxs("div",{style:{background:"var(--bg-inset)",border:"1px solid var(--line)",borderRadius:"var(--r-sm)",overflow:"hidden"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"4px 8px",borderBottom:"1px solid var(--line)",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:[l.jsx("span",{children:b&&!x?"changes":"payload"}),l.jsx("span",{style:{flex:1}}),b&&l.jsxs("button",{type:"button",onClick:()=>p(!x),style:{display:"inline-flex",alignItems:"center",gap:4,background:"none",border:"none",color:"var(--ink-2)",cursor:"pointer",font:"inherit",padding:0},children:[l.jsx(ie,{name:"raw",size:12}),x?"diff":"raw"]})]}),l.jsx("div",{style:{padding:"6px 0",maxHeight:260,overflow:"auto"},children:b&&!x?l.jsx(O0,{tool:i,input:h}):l.jsx("pre",{style:{margin:0,padding:"0 8px",fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",whiteSpace:"pre-wrap",wordBreak:"break-word",color:"var(--ink-0)"},children:h?JSON.stringify(h,null,2):String(u??"")})})]})]})}const U0=/(`[^`\n]+`|\*\*[^*\n]+\*\*|<[^<>\n]{1,80}>)/g;function cr(i,c){return i.split(U0).filter(Boolean).map((u,o)=>u.startsWith("`")&&u.endsWith("`")&&u.length>2?l.jsx("code",{style:{fontFamily:"var(--font-mono)",fontSize:"0.92em",background:"var(--bg-inset)",border:"1px solid var(--line)",borderRadius:4,padding:"0 5px"},children:u.slice(1,-1)},o):u.startsWith("**")&&u.endsWith("**")&&u.length>4?l.jsx("strong",{style:{fontWeight:"var(--fw-semibold)",color:"var(--ink-0)"},children:u.slice(2,-2)},o):c&&u.startsWith("<")&&u.endsWith(">")?l.jsx("span",{style:{background:"var(--brand-wash-strong)",border:"1px dashed var(--brand)",borderRadius:4,padding:"0 5px",color:"var(--ink-0)"},children:u.slice(1,-1)},o):u)}function H0(i){const c=String(i||"").replace(/\r\n?/g,`
|
|
22
|
+
`).split(`
|
|
23
|
+
`),u=[];let o=0;for(;o<c.length;){const d=c[o];if(/^```/.test(d)){const y=d.slice(3).trim(),x=[];for(o++;o<c.length&&!/^```/.test(c[o]);)x.push(c[o++]);o++,u.push({t:"code",lang:y,body:x.join(`
|
|
24
|
+
`)});continue}if(/^>\s?/.test(d)){const y=[];for(;o<c.length&&/^>\s?/.test(c[o]);)y.push(c[o++].replace(/^>\s?/,""));u.push({t:"quote",body:y});continue}if(/^\s*[-*]\s+/.test(d)){const y=[];for(;o<c.length&&/^\s*[-*]\s+/.test(c[o]);)y.push(c[o++].replace(/^\s*[-*]\s+/,""));u.push({t:"list",items:y});continue}const h=/^(#{1,3})\s+(.*)$/.exec(d);if(h){u.push({t:"h",level:h[1].length,body:h[2]}),o++;continue}if(!d.trim()){o++;continue}const m=[];for(;o<c.length&&c[o].trim()&&!/^(```|>|\s*[-*]\s|#{1,3}\s)/.test(c[o]);)m.push(c[o++]);u.push({t:"p",body:m})}return u}function $i({text:i,slots:c=!0,style:u}){const o=H0(i);return l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10,lineHeight:"var(--lh-prose)",color:"var(--ink-prose, var(--ink-0))",...u},children:o.map((d,h)=>d.t==="code"?l.jsxs("pre",{style:{margin:0,padding:"var(--sp-2) var(--sp-3)",background:"var(--bg-inset)",border:"1px solid var(--line)",borderRadius:"var(--r-sm)",fontFamily:"var(--font-mono)",fontSize:"var(--fs-sm)",lineHeight:"var(--lh)",overflowX:"auto",whiteSpace:"pre",position:"relative"},children:[d.lang&&l.jsx("span",{style:{position:"absolute",top:4,right:8,fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:d.lang}),d.body]},h):d.t==="quote"?l.jsx("blockquote",{style:{margin:0,padding:"2px 0 2px 12px",borderLeft:"2px solid var(--agent-worker)",color:"var(--ink-1)"},children:d.body.map((m,y)=>l.jsx("div",{children:cr(m,c)},y))},h):d.t==="list"?l.jsx("ul",{style:{margin:0,paddingLeft:20},children:d.items.map((m,y)=>l.jsx("li",{children:cr(m,c)},y))},h):d.t==="h"?l.jsx("div",{style:{fontWeight:"var(--fw-semibold)",fontSize:d.level===1?"var(--fs-lg)":"var(--fs-md)",color:"var(--ink-0)",marginTop:h?4:0},children:cr(d.body,c)},h):l.jsx("p",{style:{margin:0},children:d.body.map((m,y)=>l.jsxs(vn.Fragment,{children:[y>0&&l.jsx("br",{}),cr(m,c)]},y))},h))})}const nv=new Set(["spawn_worker","message_worker","ask_human"]);function su({agent:i,title:c,kind:u="text",body:o,ts:d,to:h,timing:m,dense:y=!1,style:x}){const p=u==="tool";if(p&&y)return l.jsx(q0,{agent:i,title:c,body:o,ts:d,style:x});if(u==="system"&&!o&&typeof c=="string"&&c.startsWith("result ·"))return l.jsx($0,{agent:i,title:c,ts:d,style:x});const S=u==="steer",b=u==="result",k=u==="error"?"var(--status-critical)":S?"var(--ink-0)":u==="text"?vr(i):void 0,w=d?new Date(d).toLocaleTimeString(void 0,{hour12:!1}):null,_=p?String(c||"tool").replace(/^[^\w]+/,""):null,X=p?null:c;return l.jsxs(iu,{accent:k,style:{padding:"var(--sp-2) var(--sp-3)",...b?{fontFamily:"var(--font-mono)",fontSize:"var(--fs-sm)"}:null,...u==="system"?{color:"var(--ink-1)",fontSize:"var(--fs-sm)"}:null,...x},children:[l.jsxs("div",{style:{fontSize:"var(--fs-xs)",color:u==="error"?"var(--status-critical)":"var(--ink-2)",marginBottom:4,display:"flex",alignItems:"center",gap:6,fontFamily:"var(--font-ui)"},children:[l.jsx(mn,{agent:i,size:"sm"}),l.jsx("span",{children:i}),S&&h&&l.jsxs(l.Fragment,{children:[l.jsx(ie,{name:"chevronRight",size:11}),l.jsx(mn,{agent:h,size:"sm"}),l.jsx("span",{children:h})]}),S&&m&&l.jsxs(l.Fragment,{children:[l.jsx("span",{children:"·"}),l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[l.jsx(ie,{name:m==="now"?"now":"nextTurn",size:11}),m==="now"?"now":"next turn"]})]}),X&&X!==i&&l.jsxs(l.Fragment,{children:[l.jsx("span",{children:"·"}),l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[u==="error"&&l.jsx(ie,{name:"error",size:11,strokeWidth:2.25}),X]})]}),p&&nv.has(_)&&l.jsxs(l.Fragment,{children:[l.jsx("span",{children:"·"}),l.jsx("span",{style:{color:"var(--brand)"},children:"orchestration"})]}),w&&l.jsx("span",{style:{marginLeft:"auto",fontVariantNumeric:"tabular-nums"},children:w})]}),p?l.jsx(tv,{tool:_,body:o}):u==="text"&&typeof o=="string"?l.jsx($i,{text:o}):l.jsx(B0,{body:o})]})}const pp=12;function B0({body:i}){const[c,u]=g.useState(!1),o=typeof i=="string"?i:null,d=o?o.split(`
|
|
25
|
+
`):[];if(!(o!==null&&(d.length>pp+4||o.length>1600)))return l.jsx("div",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:i});const m=c?o:d.slice(0,pp).join(`
|
|
26
|
+
`).slice(0,1600);return l.jsxs("div",{children:[l.jsxs("div",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:[m,!c&&`
|
|
27
|
+
…`]}),l.jsx("button",{type:"button",onClick:()=>u(!c),style:{marginTop:4,padding:0,background:"none",border:"none",cursor:"pointer",font:"inherit",fontFamily:"var(--font-ui)",fontSize:"var(--fs-xs)",color:"var(--brand)"},children:c?"Show less":`Show all · ${d.length} lines`})]})}function $0({agent:i,title:c,ts:u,style:o}){const d=u?new Date(u).toLocaleTimeString(void 0,{hour12:!1}):null;return l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px var(--sp-2)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",whiteSpace:"nowrap",overflow:"hidden",...o},children:[l.jsx(mn,{agent:i,size:"sm"}),l.jsx("span",{children:i}),l.jsx("span",{children:"·"}),l.jsx("span",{children:c.replace(/^result · /,"turn ended · ")}),d&&l.jsx("span",{style:{marginLeft:"auto",fontVariantNumeric:"tabular-nums"},children:d})]})}function q0({agent:i,title:c,body:u,ts:o,style:d}){const h=String(c||"tool").replace(/^[^\w]+/,""),m=ev(h,Pp(u))||(typeof u=="string"?u:""),y=String(m).replace(/\s+/g," ").slice(0,90),x=o?new Date(o).toLocaleTimeString(void 0,{hour12:!1}):null;return l.jsxs("div",{title:typeof u=="string"?u.slice(0,2e3):void 0,style:{display:"flex",alignItems:"center",gap:6,padding:"1px var(--sp-2)",fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",whiteSpace:"nowrap",overflow:"hidden",minWidth:0,...d},children:[l.jsx(mn,{agent:i,size:"sm"}),l.jsx(ie,{name:h,size:12}),l.jsx("span",{style:{color:nv.has(h)?"var(--brand)":"var(--ink-1)",flex:"0 0 auto"},children:h}),l.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:y}),x&&l.jsx("span",{style:{marginLeft:"auto",fontVariantNumeric:"tabular-nums",flex:"0 0 auto"},children:x})]})}function Ya({icon:i,label:c,onClick:u,active:o,size:d="md",disabled:h,style:m}){const[y,x]=g.useState(!1),p=d==="sm"?26:32;return l.jsx("button",{type:"button",title:c,"aria-label":c,"aria-pressed":o,disabled:h,onClick:u,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),style:{width:p,height:p,display:"inline-flex",alignItems:"center",justifyContent:"center",padding:0,borderRadius:"var(--r-sm)",cursor:h?"default":"pointer",background:o?"var(--bg-card)":y?"var(--bg-hover)":"transparent",border:`1px solid ${o?"var(--line-strong)":"transparent"}`,color:o||y?"var(--ink-0)":"var(--ink-1)",opacity:h?.5:1,transition:"background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease)",...m},children:l.jsx(ie,{name:i,size:d==="sm"?14:16})})}function mr(i){if(!i)return"";let c=String(i).replace(/^\/(Users|home)\/[^/]+/,"~");const u=c.split("/");return u.length>4&&(c=[u[0],u[1],"…",...u.slice(-2)].join("/")),c}function av({size:i=24,mono:c,style:u}){const o=c?"currentColor":"var(--brand)",d=c?"currentColor":"var(--agent-worker)";return l.jsxs("svg",{viewBox:"0 0 32 32",width:i,height:i,"aria-hidden":!0,style:{flex:"0 0 auto",display:"block",...u},children:[l.jsx("rect",{x:"5",y:"4",width:"6",height:"24",rx:"3",fill:o}),l.jsx("rect",{x:"5",y:"4",width:"22",height:"6",rx:"3",fill:o}),l.jsx("rect",{x:"5",y:"13",width:"15",height:"6",rx:"3",fill:d,opacity:c?.55:1})]})}function L0({size:i=22,tagline:c,mono:u,style:o}){return l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:Math.round(i*.4),...o},children:[l.jsx(av,{size:i,mono:u}),l.jsx("span",{style:{fontSize:Math.round(i*.82),fontWeight:"var(--fw-semibold)",letterSpacing:"-0.01em",color:u?"currentColor":"var(--ink-0)",lineHeight:1},children:"Foreman"}),c&&l.jsx("span",{style:{color:"var(--ink-2)",fontSize:"var(--fs-sm)",marginLeft:4},children:c})]})}function Y0({folder:i}){const[c,u]=vn.useState(!1),[o,d]=vn.useState(!1),h=()=>{navigator.clipboard&&navigator.clipboard.writeText(i).catch(()=>{}),u(!0),setTimeout(()=>u(!1),1200)};return l.jsxs("button",{type:"button",onClick:h,title:c?"Copied":i,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),style:{display:"inline-flex",alignItems:"center",gap:6,minWidth:0,maxWidth:420,padding:"3px 8px",borderRadius:999,border:"1px solid transparent",background:o?"var(--bg-inset, rgba(255,255,255,.06))":"transparent",color:c?"var(--ink-1)":"var(--ink-2)",cursor:"pointer",font:"inherit"},children:[l.jsx(ie,{name:"folder",size:13}),l.jsx("span",{style:{fontSize:"var(--fs-xs)",fontFamily:"var(--font-mono)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c?"copied":mr(i)})]})}function lv({mode:i="fleet",title:c,subtitle:u="mission control",folder:o,branch:d,onBack:h,theme:m,onToggleTheme:y,onSettings:x,version:p,search:S,children:b,style:k}){const w=i==="fleet";return l.jsxs("header",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)",padding:w?"var(--sp-3) var(--sp-5)":"var(--sp-2) var(--sp-3)",background:"var(--bg-panel)",borderBottom:"1px solid var(--line)",flex:"0 0 auto",minHeight:48,...k},children:[w?l.jsx(L0,{size:22,tagline:u}):l.jsxs("nav",{"aria-label":"Breadcrumb",style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",minWidth:0},children:[l.jsx("button",{type:"button",onClick:h,title:"Back to the fleet","aria-label":"Back to the fleet",style:{background:"none",border:0,padding:0,cursor:"pointer",display:"inline-flex",alignItems:"center"},children:l.jsx(av,{size:22})}),l.jsx("button",{type:"button",onClick:h,style:{background:"none",border:0,padding:0,font:"inherit",color:"var(--ink-2)",cursor:"pointer"},children:"Fleet"}),l.jsx(ie,{name:"chevronRight",size:14,color:"var(--ink-3, var(--ink-2))"}),l.jsx("span",{style:{fontWeight:"var(--fw-semibold)",whiteSpace:"nowrap"},children:c}),o&&l.jsx(Y0,{folder:o}),d&&l.jsxs("span",{title:d.hint??`On branch ${d.name}${d.dirty?" · uncommitted changes":""}`,style:{display:"inline-flex",alignItems:"center",gap:5,padding:"2px 8px",borderRadius:999,border:"1px solid var(--line)",fontSize:"var(--fs-xs)",fontFamily:"var(--font-mono)",color:"var(--ink-1)",whiteSpace:"nowrap",maxWidth:260},children:[l.jsx("span",{"aria-hidden":!0,style:{color:"var(--ink-2)"},children:"⎇"}),l.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis"},children:d.name}),d.dirty&&l.jsx("span",{"aria-label":"uncommitted changes",style:{width:6,height:6,borderRadius:"50%",background:"var(--status-warning)",flex:"0 0 auto"}})]})]}),S&&l.jsx("div",{style:{flex:"1 1 auto",display:"flex",justifyContent:"center",minWidth:0,padding:"0 var(--sp-3)"},children:S}),l.jsxs("div",{style:{marginLeft:S?0:"auto",display:"flex",alignItems:"center",gap:"var(--sp-3)",flexWrap:"wrap",justifyContent:"flex-end"},children:[b,y&&l.jsx(Ya,{icon:m==="light"?"moon":"sun",label:m==="light"?"Switch to dark theme":"Switch to light theme",onClick:y}),x&&l.jsx(Ya,{icon:"settings",label:"Settings",onClick:x}),p&&l.jsxs("a",{href:"https://github.com/amenophis1er/foreman/releases",target:"_blank",rel:"noopener noreferrer",title:`Foreman ${p} — release notes`,style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",textDecoration:"none",whiteSpace:"nowrap"},children:["v",p]})]})]})}function Qe({children:i}){return l.jsx("div",{style:{color:"var(--ink-2)",fontSize:"var(--fs-sm)"},children:i})}function pn({children:i,style:c}){return l.jsx("h2",{style:{margin:"0 0 var(--sp-2)",fontSize:"var(--fs-xs)",fontWeight:"var(--fw-semibold)",textTransform:"uppercase",letterSpacing:"var(--ls-caps)",color:"var(--ink-2)",...c},children:i})}const vp={readonly:{icon:"readonly",color:"var(--status-warning)"},disconnected:{icon:"disconnected",color:"var(--status-serious)"},error:{icon:"error",color:"var(--status-critical)"},caution:{icon:"caution",color:"var(--status-serious)"}};function Fe({tone:i="readonly",children:c,inline:u,style:o}){const d=vp[i]??vp.readonly;return u?l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,color:d.color,fontSize:"var(--fs-sm)",...o},children:[l.jsx(ie,{name:d.icon,size:13,strokeWidth:2}),c]}):l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"var(--sp-1) var(--sp-3)",background:"var(--bg-inset)",borderBottom:"1px solid var(--line)",fontSize:"var(--fs-sm)",color:"var(--ink-1)",...o},children:[l.jsx(ie,{name:d.icon,size:14,color:d.color}),c]})}function iv(i,c=Date.now()){const u=Math.max(0,Math.round((c-i)/1e3));if(u<60)return`${u}s`;const o=Math.floor(u/60);if(o<60)return`${o}m`;const d=Math.floor(o/60);return d<24?o%60?`${d}h ${o%60}m`:`${d}h`:`${Math.floor(d/24)}d`}const G0={permission:"approval",question:"director asks",planner:"the planner is asking",summary:"needs you"};function mp(i,c){return`${i} ${c}${i>1?"s":""}`}function W0({item:i,onPermission:c,onAnswer:u,onPlanner:o,onOpen:d}){const[h,m]=g.useState(!1),[y,x]=g.useState(""),[p,S]=g.useState(!1),[b,k]=g.useState("");g.useEffect(()=>{m(!1),x(""),S(!1),k("")},[i.id]);const w=async N=>{if(!h){m(!0),x("");try{const Z=await N();Z&&(x(Z),m(!1))}catch(Z){x(Z instanceof Error?Z.message:String(Z)),m(!1)}}},_=N=>i.kind==="planner"?w(()=>o(i,N)):w(()=>u(i,N)),X=()=>{const N=b.trim();N&&_(N)},M=Array.isArray(i.options)&&i.options.length>0,z=i.kind==="question"||i.kind==="planner",R=z&&(p||!M);return l.jsxs("div",{className:h?void 0:"pulse",style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)",padding:"var(--sp-3) var(--sp-4)",background:"var(--brand-wash-strong)",border:"1px solid var(--status-warning)",borderLeft:"var(--accent-w) solid var(--status-warning)",borderRadius:"var(--r-md)",opacity:h?.7:1,transition:"opacity var(--dur-fast) var(--ease)"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--sp-2)",minWidth:0,fontSize:"var(--fs-sm)"},children:[l.jsx(ie,{name:i.kind==="permission"?"approval":i.kind==="summary"?"needsYou":"question",size:14,strokeWidth:2,color:"var(--status-warning)",style:{alignSelf:"center",flex:"0 0 auto"}}),l.jsx("span",{style:{fontWeight:"var(--fw-semibold)",color:"var(--ink-0)",flex:"0 0 auto"},children:i.projectName}),l.jsx("span",{style:{color:"var(--status-warning)",fontWeight:"var(--fw-medium)",flex:"0 0 auto"},children:G0[i.kind]??i.kind}),l.jsx("span",{title:i.text,style:{color:"var(--ink-0)",minWidth:0,flex:"1 1 auto",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i.text}),typeof i.since=="number"&&l.jsxs("span",{style:{color:"var(--ink-2)",fontSize:"var(--fs-xs)",fontVariantNumeric:"tabular-nums",flex:"0 0 auto"},children:["waiting ",iv(i.since)]})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[i.kind==="permission"&&l.jsxs(l.Fragment,{children:[l.jsx(le,{size:"sm",variant:"good",disabled:h,onClick:()=>{w(()=>c(i,"allow"))},children:"Allow"}),l.jsx(le,{size:"sm",variant:"danger",disabled:h,onClick:()=>{w(()=>c(i,"deny"))},children:"Deny"})]}),z&&M&&i.options.map((N,Z)=>l.jsxs("button",{type:"button",disabled:h,onClick:()=>{_(N)},title:Z===0?"Recommended":void 0,style:{display:"inline-flex",alignItems:"center",gap:5,padding:"4px 10px",borderRadius:"var(--r-sm)",cursor:h?"default":"pointer",font:"inherit",fontSize:"var(--fs-sm)",textAlign:"left",maxWidth:360,background:"var(--bg-card)",border:"1px solid var(--line-strong)",color:"var(--ink-0)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[Z===0&&l.jsx("span",{style:{color:"var(--status-warning)",fontSize:"var(--fs-xs)"},children:"★"}),N]},N)),z&&M&&!p&&l.jsx(le,{size:"sm",variant:"ghost",disabled:h,onClick:()=>S(!0),children:"type…"}),R&&l.jsxs("form",{onSubmit:N=>{N.preventDefault(),X()},style:{display:"flex",alignItems:"center",gap:6,flex:"1 1 16rem",minWidth:0},children:[l.jsx("input",{autoFocus:p,value:b,disabled:h,placeholder:i.kind==="planner"?"Answer the planner…":"Answer the director…",onChange:N=>k(N.target.value),onKeyDown:N=>{N.key==="Escape"&&M&&(S(!1),k(""))},style:{flex:"1 1 auto",minWidth:0,font:"inherit",fontSize:"var(--fs-sm)",padding:"4px 8px",borderRadius:"var(--r-sm)",background:"var(--bg-card)",border:"1px solid var(--line-strong)",color:"var(--ink-0)",outline:"none"}}),l.jsx(le,{size:"sm",type:"submit",icon:"send",disabled:h||!b.trim(),children:"Send"})]}),l.jsx("span",{style:{marginLeft:"auto",flex:"0 0 auto"},children:l.jsx(le,{size:"sm",variant:"ghost",onClick:()=>d?.(i.projectId),title:"Open the project for the full context",children:"open"})})]}),y&&l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5,fontSize:"var(--fs-xs)",color:"var(--text-danger)"},children:[l.jsx(ie,{name:"caution",size:12,strokeWidth:2}),y]})]})}function X0({items:i=[],onPermission:c,onAnswer:u,onPlanner:o,onOpen:d,style:h}){return i.length?l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)",...h},children:i.map(m=>l.jsx(W0,{item:m,onPermission:c,onAnswer:u,onPlanner:o,onOpen:d},`${m.projectId}:${m.kind}:${m.id??""}`))}):null}function V0({approvals:i=0,questions:c=0,planner:u=!1}){const o=[];i>0&&o.push(mp(i,"approval"));const d=u?c-1:c;return d>0&&o.push(mp(d,"question")),u&&o.push("the planner is asking"),o.join(", ")}function Q0(i){const c=Math.max(0,Math.round(Number(i)||0)/1e3);if(c<60)return`${Math.round(c)}s`;const u=Math.round(c/60);return u<60?`${u}m`:`${Math.floor(u/60)}h ${String(u%60).padStart(2,"0")}m`}function Ga(i){return i>=1e6?`${(i/1e6).toFixed(1)}m`:i>=1e3?`${(i/1e3).toFixed(1)}k`:String(i)}const K0=i=>i?i.inputTokens+i.outputTokens+i.cacheReadTokens+i.cacheWriteTokens:0,Z0="repeating-linear-gradient(-45deg, var(--line-strong) 0 3px, transparent 3px 7px)";function sv({spent:i,budget:c,costBasis:u="priced",usage:o=null,turns:d,elapsedMs:h,detail:m=!1,style:y}){const x=typeof h=="number"&&h>0?` · ${Q0(h)}`:"";if(i=Number(i)||0,c=Number(c)||0,u!=="priced"){const k=u==="unpriced",w=K0(o);return l.jsxs("div",{title:k?"Real spend, on an account Foreman cannot price — no table for this endpoint, or a plan being drawn down. Check the provider for the bill; turns and tokens are all that is known here.":"Runs on hardware you already own, so nothing is billed per token. Turns and tokens are the only real units.",style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",minWidth:170,...y},children:[l.jsx("div",{style:{flex:1,height:"var(--meter-h)",background:"var(--bg-inset)",borderRadius:2,overflow:"hidden",backgroundImage:k?Z0:void 0}}),l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:"var(--fs-sm)",color:"var(--ink-1)",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"},children:[m?`${Ga(o?.inputTokens??0)} in · ${Ga(o?.outputTokens??0)} out`:`${Ga(w)} tok`,typeof d=="number"?` · ${d} turn${d===1?"":"s"}`:"",x]})]})}const p=c>0?Math.min(i/c,1):0,S=p>=.9?"critical":p>=.7?"warning":"ok",b=S==="critical"?"var(--status-critical)":S==="warning"?"var(--status-warning)":"var(--brand)";return l.jsxs("div",{title:`$${i.toFixed(2)} spent of $${c.toFixed(2)} budget`,style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",minWidth:170,...y},children:[l.jsx("div",{style:{flex:1,height:"var(--meter-h)",background:"var(--bg-inset)",borderRadius:2,overflow:"hidden"},children:l.jsx("div",{style:{width:`${p*100}%`,height:"100%",background:b,transition:"width var(--dur-meter)"}})}),l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:"var(--fs-sm)",color:"var(--ink-1)",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"},children:[S!=="ok"&&l.jsx(ie,{name:S,size:12,strokeWidth:2.25,color:b}),"$",i.toFixed(2)," / $",c.toFixed(0),x]})]})}function F0({name:i,folder:c,title:u,mission:o,activity:d,costUsd:h,budgetUsd:m,costBasis:y,usage:x,turns:p,directorModel:S,workerModel:b,createdAt:k,onOpen:w,style:_}){const[X,M]=g.useState(!1),z=[S,b].filter(Boolean);return l.jsxs("div",{role:"button",tabIndex:0,onClick:w,onKeyDown:R=>{(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),w?.())},onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),style:{display:"grid",gridTemplateColumns:"minmax(9rem, 12rem) minmax(0, 1fr) minmax(11rem, 15rem) auto",gap:"var(--sp-4)",alignItems:"center",padding:"var(--sp-3) var(--sp-4)",cursor:"pointer",background:X?"var(--bg-hover)":"transparent",borderLeft:`var(--accent-w) solid ${X?"var(--brand)":"transparent"}`,transition:"background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease)",..._},children:[l.jsxs("div",{style:{minWidth:0},children:[l.jsx("div",{style:{fontSize:"var(--fs-md)",fontWeight:"var(--fw-semibold)",color:"var(--ink-0)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i}),l.jsx("div",{title:c,style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontFamily:"var(--font-mono)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:mr(c)})]}),l.jsxs("div",{style:{minWidth:0},children:[l.jsx("div",{title:o,style:{fontSize:"var(--fs-md)",color:"var(--ink-0)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u||o}),d&&l.jsx("div",{className:"ticker",title:d,style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontFamily:"var(--font-mono)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d},d)]}),l.jsx(sv,{spent:h,budget:m,costBasis:y,usage:x,turns:p}),l.jsxs("div",{style:{textAlign:"right",fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontFamily:"var(--font-mono)",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"},children:[z.length>0&&l.jsx("div",{title:"director · worker",style:{maxWidth:"16rem",overflow:"hidden",textOverflow:"ellipsis"},children:z.join(" · ")}),typeof k=="number"&&l.jsx("div",{children:iv(k)})]})]})}function J0(i){return new Date(i).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Hc(){return l.jsx("span",{style:{color:"var(--ink-2)",opacity:.6},children:"·"})}function I0({name:i,folder:c,lastRun:u,onOpen:o,onUnlink:d,style:h}){const[m,y]=g.useState(!1),[x,p]=g.useState(!1),S=u?.usage?u.usage.inputTokens+u.usage.outputTokens:null;return l.jsxs("article",{role:"button",tabIndex:0,onClick:o,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),o?.())},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),style:{background:"var(--bg-card)",borderRadius:"var(--r-md)",cursor:"pointer",border:`1px solid ${m?"var(--line-strong)":"var(--line)"}`,padding:"var(--sp-3) var(--sp-4)",display:"flex",flexDirection:"column",gap:6,minWidth:0,transition:"border-color var(--dur-fast) var(--ease)",...h},children:[l.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--sp-2)",minWidth:0},children:[l.jsx("span",{style:{fontSize:"var(--fs-md)",fontWeight:"var(--fw-semibold)",color:"var(--ink-0)",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i}),l.jsx("span",{title:c,style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontFamily:"var(--font-mono)",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginLeft:"auto"},children:mr(c)})]}),u?l.jsxs(l.Fragment,{children:[l.jsx("div",{title:u.mission,style:{fontSize:"var(--fs-sm)",color:"var(--ink-1)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u.title||u.mission}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontVariantNumeric:"tabular-nums"},children:[l.jsx(ya,{status:u.status}),u.createdAt&&l.jsxs(l.Fragment,{children:[l.jsx(Hc,{}),J0(u.createdAt)]}),u.costBasis==="priced"?l.jsxs(l.Fragment,{children:[l.jsx(Hc,{}),"$",(Number(u.costUsd)||0).toFixed(2)]}):S!==null?l.jsxs(l.Fragment,{children:[l.jsx(Hc,{}),Ga(S)," tok"]}):null]})]}):l.jsx("div",{style:{fontSize:"var(--fs-sm)",color:"var(--ink-2)"},children:"No missions yet — open to compose one."}),l.jsx("div",{style:{display:"flex",justifyContent:"flex-end",height:14,marginTop:-2},children:l.jsxs("button",{type:"button",tabIndex:m?0:-1,onClick:b=>{b.stopPropagation(),d?.()},onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),title:"Unlink project (run history is kept)",style:{display:"inline-flex",alignItems:"center",gap:4,background:"none",border:"none",cursor:"pointer",padding:0,font:"inherit",fontSize:"var(--fs-xs)",color:x?"var(--ink-0)":"var(--ink-2)",opacity:m?1:0,pointerEvents:m?"auto":"none",transition:"opacity var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease)"},children:[l.jsx(ie,{name:"unlink",size:11}),"Unlink"]})})]})}function P0({onClick:i,style:c}){const[u,o]=g.useState(!1);return l.jsxs("div",{role:"button",onClick:i,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{border:`1px dashed ${u?"var(--ink-2)":"var(--line-strong)"}`,borderRadius:"var(--r-md)",minHeight:"var(--card-min-h)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--sp-2)",cursor:"pointer",color:u?"var(--ink-0)":"var(--ink-1)",background:u?"var(--bg-hover)":"transparent",transition:"border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease)",...c},children:[l.jsx(ie,{name:"add",size:22,strokeWidth:1.5}),l.jsx("span",{style:{fontSize:"var(--fs-sm)"},children:"Link a project"}),l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:"or drop a folder anywhere"})]})}const gp={ok:{icon:"done",color:"var(--status-good)"},warn:{icon:"caution",color:"var(--status-serious)"},error:{icon:"critical",color:"var(--status-critical)"}};function e1({load:i,onSettings:c,onInstallBrowser:u,install:o,style:d}){const[h,m]=g.useState(null),[y,x]=g.useState(!1),[p,S]=g.useState(null),b=async()=>{x(!0),S(null);try{const w=await i();if(!w.ok)throw new Error(`HTTP ${w.status}`);m((await w.json()).checks??[])}catch(w){S(w instanceof Error?w.message:String(w))}finally{x(!1)}};g.useEffect(()=>{b()},[]);const k=(h??[]).filter(w=>w.status!=="ok").length;return l.jsxs("section",{style:{border:"1px solid var(--line)",borderRadius:"var(--r-md)",background:"var(--bg-card)",padding:"var(--sp-3) var(--sp-4)",textAlign:"left",display:"flex",flexDirection:"column",gap:"var(--sp-2)",...d},children:[l.jsxs("header",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[l.jsx("span",{style:{fontSize:"var(--fs-sm)",fontWeight:"var(--fw-semibold)",flex:1},children:"This machine"}),h&&l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:k?"var(--status-serious)":"var(--ink-2)"},children:k?`${k} thing${k===1?"":"s"} to look at`:"ready"}),l.jsx(le,{variant:"ghost",size:"sm",icon:y?"loading":"resume",onClick:b,disabled:y,children:"Check again"}),l.jsx(le,{variant:"ghost",size:"sm",onClick:()=>{window.location.hash="#/setup"},children:"Walk-through"})]}),p&&l.jsxs("div",{style:{fontSize:"var(--fs-xs)",color:"var(--status-critical)"},children:["Could not run the checks: ",p]}),!h&&!p&&l.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:"Checking…"}),h&&l.jsx("div",{style:{display:"flex",flexDirection:"column"},children:h.map(w=>{const _=gp[w.status]||gp.warn;return l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"16px minmax(0, 1fr)",columnGap:"var(--sp-2)",padding:"5px 0",borderTop:"1px solid var(--line)",fontSize:"var(--fs-sm)"},children:[l.jsx(ie,{name:_.icon,size:14,color:_.color,style:{marginTop:2}}),l.jsxs("div",{style:{minWidth:0},children:[l.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",alignItems:"baseline",minWidth:0},children:[l.jsx("span",{style:{color:"var(--ink-0)",flex:"0 0 auto"},children:w.name}),l.jsx("span",{style:{color:"var(--ink-2)",minWidth:0,overflowWrap:"anywhere"},children:w.detail})]}),w.fix&&w.status!=="ok"&&l.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-1)",marginTop:2,overflowWrap:"anywhere"},children:w.fix}),w.name==="Browser"&&w.status!=="ok"&&!/install-deps/.test(w.fix||"")&&u&&l.jsxs("div",{style:{marginTop:4,display:"flex",alignItems:"center",gap:"var(--sp-2)",flexWrap:"wrap"},children:[l.jsx(le,{size:"sm",icon:o?.state==="running"?"loading":"add",disabled:o?.state==="running",onClick:u,children:o?.state==="running"?"Installing…":"Install Playwright Chromium"}),o&&l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:o.state==="error"?"var(--status-critical)":"var(--ink-2)",fontFamily:"var(--font-mono)"},children:o.state==="error"?o.error:o.progress})]})]})]},w.name)})}),l.jsxs("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",lineHeight:"var(--lh)"},children:["A project can run on a provider of its own — an Anthropic API key, a Codex login or any OpenAI-compatible endpoint — from"," ",l.jsx("button",{type:"button",onClick:c,style:{background:"none",border:"none",padding:0,font:"inherit",color:"var(--brand)",cursor:"pointer",textDecoration:"underline"},children:"Settings → Provider"})," ","once it is linked."]})]})}function Nl({width:i=480,children:c,onClose:u,dismissible:o=!0,style:d}){return l.jsx("div",{onClick:h=>{o&&h.target===h.currentTarget&&u?.()},style:{position:"fixed",inset:0,background:"var(--scrim)",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center"},children:l.jsx("div",{style:{width:i,maxHeight:"70vh",display:"flex",flexDirection:"column",background:"var(--bg-panel)",border:"1px solid var(--line-strong)",borderRadius:"var(--r-md)",overflow:"hidden",...d},children:c})})}function gr({children:i,style:c}){return l.jsx("div",{style:{padding:"var(--sp-3)",borderBottom:"1px solid var(--line)",wordBreak:"break-all",...c},children:i})}function Ul({children:i,style:c}){return l.jsx("div",{style:{display:"flex",gap:"var(--sp-2)",alignItems:"center",padding:"var(--sp-3)",borderTop:"1px solid var(--line)",...c},children:i})}function Be({value:i,onChange:c,placeholder:u,type:o="text",min:d,max:h,step:m,width:y,mono:x,prefix:p,autoFocus:S,onKeyDown:b,style:k}){const w=l.jsx("input",{type:o,min:d,max:h,step:m,value:i,autoFocus:S,placeholder:u,onKeyDown:b,onChange:_=>c?.(o==="number"?Number(_.target.value):_.target.value),style:{width:p?"100%":y??"100%",background:p?"transparent":"var(--bg-card)",border:p?"none":"1px solid var(--line-strong)",borderRadius:"var(--r-sm)",padding:p?"6px 9px 6px 0":"6px 9px",color:"var(--ink-0)",outline:p?"none":void 0,fontFamily:x?"var(--font-mono)":"var(--font-ui)",...p?null:k}});return p?l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",width:y??"100%",boxSizing:"border-box",background:"var(--bg-card)",border:"1px solid var(--line-strong)",borderRadius:"var(--r-sm)",paddingLeft:9,...k},children:[l.jsx("span",{style:{color:"var(--ink-2)",marginRight:4,userSelect:"none"},children:p}),w]}):w}function sn({tabs:i,value:c,onChange:u,size:o="md",style:d}){return l.jsx("div",{role:"tablist",style:{display:"inline-flex",gap:2,padding:2,background:"var(--bg-inset)",border:"1px solid var(--line)",borderRadius:"var(--r-sm)",...d},children:i.map(h=>l.jsx(t1,{tab:h,selected:h.value===c,size:o,onSelect:()=>u?.(h.value)},h.value))})}function t1({tab:i,selected:c,size:u,onSelect:o}){const[d,h]=g.useState(!1);return l.jsxs("button",{type:"button",role:"tab","aria-selected":c,onClick:o,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{display:"inline-flex",alignItems:"center",gap:6,padding:u==="sm"?"3px 8px":"5px 10px",borderRadius:4,border:"none",cursor:"pointer",fontSize:u==="sm"?"var(--fs-xs)":"var(--fs-sm)",fontWeight:c?"var(--fw-semibold)":"var(--fw-regular)",background:c?"var(--bg-card)":d?"var(--bg-hover)":"transparent",color:c?"var(--ink-0)":"var(--ink-1)",whiteSpace:"nowrap",boxShadow:c?"inset 0 0 0 1px var(--line-strong)":"none",transition:"background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease)"},children:[i.icon&&l.jsx(ie,{name:i.icon,size:u==="sm"?12:14}),i.label,i.count>0&&l.jsx("span",{style:{fontSize:"var(--fs-xs)",padding:"0 5px",borderRadius:"var(--r-pill)",lineHeight:"16px",background:i.attention?"var(--status-warning)":"var(--line-strong)",color:i.attention?"var(--brand-ink)":"var(--ink-0)",fontWeight:"var(--fw-semibold)"},children:i.count})]})}function yp({children:i,icon:c,onClick:u}){const[o,d]=g.useState(!1);return l.jsxs("div",{role:"button",onClick:u,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),style:{display:"flex",alignItems:"center",gap:8,padding:"7px 12px",cursor:"pointer",fontSize:"var(--fs-md)",background:o?"var(--bg-card)":"transparent",transition:"background var(--dur-fast) var(--ease)"},children:[l.jsx(ie,{name:c,size:15,color:"var(--ink-1)"}),i]})}function n1({path:i="…",parent:c,dirs:u=[],error:o,onNavigate:d,onCreate:h,onPick:m,onClone:y,cloneWhere:x,clone:p,onClose:S}){const[b,k]=g.useState("folder"),[w,_]=g.useState(!1),[X,M]=g.useState(""),[z,R]=g.useState(""),[N,Z]=g.useState(""),[re,B]=g.useState(null),L=p?.state==="running",P=!!z.trim()&&!!re?.dest&&!L;g.useEffect(()=>{if(!x)return;const te=z.trim();if(!te){B(null);return}let ee=!1;const xe=setTimeout(()=>{Promise.resolve(x(te)).then(se=>{ee||B(se)}).catch(()=>{ee||B(null)})},250);return()=>{ee=!0,clearTimeout(xe)}},[z,x]);const G=()=>{P&&y?.(z.trim(),N.trim()||void 0)},ce=b==="git"&&y;return l.jsxs(Nl,{width:520,onClose:L?void 0:S,children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)",padding:"var(--sp-3) var(--sp-3) var(--sp-2)"},children:[l.jsx("span",{style:{fontWeight:"var(--fw-semibold)"},children:"Link a project"}),y&&l.jsx(sn,{size:"sm",value:b,onChange:te=>{L||k(te)},style:{marginLeft:"auto"},tabs:[{value:"folder",label:"Folder on this machine",icon:"folder"},{value:"git",label:"Git repository",icon:"provider"}]})]}),ce?l.jsxs("div",{style:{padding:"0 var(--sp-3) var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-3)"},children:[l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[l.jsx("label",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:"Repository"}),l.jsx(Be,{autoFocus:!0,placeholder:"https://github.com/owner/repo · git@host:owner/repo.git · owner/repo",value:z,onChange:R,disabled:L,onKeyDown:te=>{te.key==="Enter"&&G()}})]}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[l.jsxs("label",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:["Branch ",l.jsx("span",{style:{color:"var(--ink-3, var(--ink-2))"},children:"· optional, the default branch otherwise"})]}),l.jsx(Be,{placeholder:"main",value:N,onChange:Z,disabled:L,width:220,onKeyDown:te=>{te.key==="Enter"&&G()}})]}),l.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-3)",background:"var(--bg-inset)",border:"1px solid var(--line)",borderRadius:"var(--r-sm)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",display:"flex",flexDirection:"column",gap:4},children:[!z.trim()&&l.jsx("span",{children:"Will be cloned under your projects root and linked as a project. Paste a URL to see the exact folder."}),z.trim()&&re?.dest&&l.jsxs("span",{children:["Will be cloned to ",l.jsx("span",{style:{fontFamily:"var(--font-mono)",color:"var(--brand)"},children:re.dest})," and linked as ",l.jsx("b",{style:{color:"var(--ink-1)"},children:re.name}),"."]}),z.trim()&&re&&!re.dest&&l.jsx("span",{style:{color:"var(--status-error)"},children:re.error}),z.trim()&&!re&&l.jsx("span",{children:"Checking…"}),l.jsxs("span",{children:["Runs ",l.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:"git clone"})," as you, with your own SSH keys and credential helpers. Foreman never asks for a token. Full clone, so the deck can diff against it."]})]}),p?.state==="running"&&l.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-1)",fontFamily:"var(--font-mono)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.progress||"Starting git…"}),p?.state==="error"&&l.jsx(Fe,{tone:"error",inline:!0,style:{fontSize:"var(--fs-xs)"},children:p.error})]}):l.jsxs(l.Fragment,{children:[l.jsx(gr,{style:{font:"var(--fs-sm) var(--font-mono)",color:"var(--brand)"},children:i}),l.jsxs("div",{style:{overflowY:"auto",flex:1},children:[c&&l.jsx(yp,{icon:"parent",onClick:()=>d?.(c),children:".."}),u.map(te=>l.jsx(yp,{icon:"folder",onClick:()=>d?.(`${i}${i.endsWith("/")?"":"/"}${te}`),children:te},te)),u.length===0&&l.jsx("div",{style:{padding:"var(--sp-3)",color:"var(--ink-2)",fontSize:"var(--fs-sm)"},children:"No subfolders."})]}),w&&l.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",alignItems:"center",padding:"var(--sp-2) var(--sp-3)",borderTop:"1px solid var(--line)"},children:[l.jsx(Be,{autoFocus:!0,placeholder:"New folder name",value:X,onChange:M,onKeyDown:te=>{te.key==="Enter"&&h?.(X)},style:{flex:1}}),l.jsx(le,{variant:"good",onClick:()=>h?.(X),children:"Create"})]}),o&&l.jsx("div",{style:{padding:"4px var(--sp-3)"},children:l.jsx(Fe,{tone:"error",inline:!0,style:{fontSize:"var(--fs-xs)"},children:o})})]}),l.jsxs(Ul,{children:[ce?null:l.jsx(le,{icon:"add",onClick:()=>_(!w),title:"Create a subfolder here",children:"New folder"}),l.jsx("span",{style:{flex:1}}),l.jsx(le,{onClick:S,disabled:L,children:"Cancel"}),ce?l.jsx(le,{variant:"primary",disabled:!P,onClick:G,children:L?"Cloning…":"Clone & link"}):l.jsx(le,{variant:"primary",onClick:()=>m?.(i),children:"Select this folder"})]})]})}function a1({name:i,matches:c,onPick:u,onClose:o}){const[d,h]=g.useState(null);return l.jsxs(Nl,{width:520,onClose:o,style:{maxHeight:"60vh"},children:[l.jsxs(gr,{children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontWeight:"var(--fw-semibold)"},children:[l.jsx(ie,{name:"folder",size:16,color:"var(--ink-1)"}),i]}),l.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",marginTop:2},children:"Browsers hide dropped folders' full paths — pick the matching location."})]}),l.jsxs("div",{style:{overflowY:"auto",flex:1},children:[c==null&&l.jsx("div",{style:{padding:"var(--sp-3)",color:"var(--ink-2)",fontSize:"var(--fs-sm)"},children:"Searching your home folder…"}),c?.map(m=>l.jsx("div",{role:"button",onClick:()=>u?.(m),onMouseEnter:()=>h(m),onMouseLeave:()=>h(null),style:{padding:"8px 12px",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"var(--fs-sm)",background:d===m?"var(--bg-card)":"transparent",transition:"background var(--dur-fast) var(--ease)"},children:m},m)),c?.length===0&&l.jsxs("div",{style:{padding:"var(--sp-3)",color:"var(--ink-2)",fontSize:"var(--fs-sm)"},children:["No folder named “",i,"” found under your home directory — use the folder picker instead."]})]}),l.jsx(Ul,{style:{justifyContent:"flex-end"},children:l.jsx(le,{onClick:o,children:"Cancel"})})]})}function l1({children:i="Drop a folder to link it"}){return l.jsxs("div",{style:{position:"absolute",inset:8,zIndex:5,pointerEvents:"none",border:"2px dashed var(--brand)",borderRadius:"var(--r-md)",background:"var(--brand-wash)",display:"flex",alignItems:"center",gap:10,justifyContent:"center",color:"var(--brand)",fontSize:"var(--fs-lg)"},children:[l.jsx(ie,{name:"folder",size:20}),i]})}function rv({title:i,body:c,confirmLabel:u="Confirm",tone:o="danger",icon:d,onConfirm:h,onCancel:m}){return l.jsxs(Nl,{width:420,onClose:m,children:[l.jsx(gr,{children:l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontWeight:"var(--fw-semibold)"},children:[d&&l.jsx(ie,{name:d,size:16,color:o==="danger"?"var(--status-critical)":"var(--ink-1)"}),i]})}),l.jsx("div",{style:{padding:"var(--sp-3)",fontSize:"var(--fs-md)",color:"var(--ink-1)",lineHeight:"var(--lh-prose)"},children:c}),l.jsxs(Ul,{style:{justifyContent:"flex-end"},children:[l.jsx(le,{onClick:m,children:"Cancel"}),l.jsx(le,{variant:o,onClick:h,children:u})]})]})}const i1=3e4;function s1(i){const[c,u]=g.useState({}),o=g.useRef(0);return g.useEffect(()=>{const d=i.map(x=>x.id),h=Date.now()-o.current>=i1,m=h?d:d.filter(x=>!(x in c));if(m.length===0)return;h&&(o.current=Date.now());let y=!0;return Promise.all(m.map(async x=>{const p=await fetch(`/projects/${encodeURIComponent(x)}/schedules`).catch(()=>null);if(!p?.ok)return[x,[]];const S=await p.json().catch(()=>({}));return[x,S.schedules??[]]})).then(x=>{y&&u(p=>({...p,...Object.fromEntries(x)}))}),()=>{y=!1}},[i,c]),c}function r1(i){const c=Math.round(i/6e4);if(c<=0)return"due now";if(c===1)return"in a minute";if(c<60)return`in ${c} min`;const u=Math.round(c/60);return u===1?"in an hour":u<48?`in ${u} h`:`in ${Math.round(u/24)} days`}function o1(i){return i==="failures"?"two runs in a row failed":i==="monthly-cap"?"this month’s scheduled spend reached its ceiling":"you paused it"}function c1(i){const c=(i??[]).filter(h=>h.enabled);if(c.length===0)return null;const u=h=>h>0?` (+${h} more scheduled)`:"",o=c.find(h=>h.pausedReason);if(o)return{paused:!0,text:`Paused — “${o.name}” will not run because ${o1(o.pausedReason)}. Resume it from the project page.${u(c.length-1)}`};const d=c.filter(h=>typeof h.nextRunAt=="number").sort((h,m)=>h.nextRunAt-m.nextRunAt)[0];return d?{paused:!1,text:`Next scheduled run ${r1(d.nextRunAt-Date.now())} — ${d.name}${u(c.length-1)}`}:{paused:!1,text:`Scheduled: “${c[0].name}” — no next run planned yet.${u(c.length-1)}`}}function u1({clock:i}){return l.jsxs("span",{tabIndex:0,role:"img",title:i.text,"aria-label":i.text,style:{position:"absolute",left:"var(--sp-4)",bottom:"var(--sp-3)",display:"inline-flex",alignItems:"center",gap:3,borderRadius:i.paused?"var(--r-pill)":"var(--r-sm)",border:i.paused?"1px solid var(--status-warning)":void 0,padding:i.paused?"0 5px":void 0,fontSize:"var(--fs-xs)",lineHeight:"15px",color:i.paused?"var(--status-warning)":"var(--ink-2)"},children:[l.jsx(ie,{name:i.paused?"interrupted":"timeline",size:i.paused?10:12}),i.paused&&"paused"]})}const xp="foreman.fleet.desk";function d1(){const[i,c]=g.useState(()=>{try{return localStorage.getItem(xp)!=="closed"}catch{return!0}});return[i,()=>c(o=>{try{localStorage.setItem(xp,o?"closed":"open")}catch{}return!o})]}function f1({onSettings:i,open:c,onToggle:u}){const o=Qp(Wg),[d,h]=g.useState(null),m=g.useRef(null),y=o.entries.filter(k=>k.kind!=="tool"),[x,p]=g.useState(!1),S=g.useRef(0);g.useEffect(()=>{c?(S.current=y.length,p(!1)):y.length>S.current&&!o.thinking&&p(!0)},[c,y.length,o.thinking]),g.useEffect(()=>{c&&m.current?.scrollIntoView({block:"end"})},[y.length,o.thinking,c]);const b=async k=>h(await o.send(k));return c?l.jsxs("aside",{style:{width:"clamp(22rem, 28vw, 30rem)",flex:"0 0 auto",minHeight:0,display:"flex",flexDirection:"column",borderLeft:"1px solid var(--line)",background:"var(--bg-panel)"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-3)",borderBottom:"1px solid var(--line)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",flex:"0 0 auto"},children:[l.jsx("span",{style:{color:"var(--ink-0)",fontSize:"var(--fs-sm)",fontWeight:"var(--fw-semibold)"},children:"Front desk"}),l.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:"the same conversation as your phone"}),l.jsxs("span",{style:{marginLeft:"auto",display:"inline-flex",gap:"var(--sp-1)",alignItems:"center",flex:"0 0 auto"},children:[o.costUsd>0&&l.jsxs("span",{title:"What this conversation has cost. Not charged to any mission.",style:{fontVariantNumeric:"tabular-nums",marginRight:"var(--sp-1)"},children:["$",o.costUsd.toFixed(2)]}),y.length>0&&!o.thinking&&l.jsx(le,{variant:"ghost",size:"sm",onClick:()=>{o.clear()},title:"Forget this conversation; the next message starts fresh",children:"Forget"}),l.jsx(Ya,{icon:"chevronRight",label:"Fold the front desk away",onClick:u})]})]}),l.jsxs("div",{style:{flex:1,minHeight:0,overflowY:"auto",padding:"var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:[y.length===0&&!o.thinking&&l.jsx(Qe,{children:"Ask how things are going, or say what you want started where. It knows every project, can open a planning conversation, propose a mission, or pass a note to a running director. It never starts a run or answers an approval for you."}),y.map(k=>l.jsx(su,{agent:k.agent,title:k.title,kind:k.kind,body:k.body,ts:k.ts},k.id)),l.jsx("div",{ref:m})]}),l.jsxs("div",{style:{flex:"0 0 auto",padding:"var(--sp-2) var(--sp-3) var(--sp-3)",borderTop:"1px solid var(--line)"},children:[l.jsx(Ic,{busy:o.thinking,who:o.who,placeholder:"How is everything going?",attach:!1,hint:"Knows the fleet. Never starts a run or answers for you.",busyHint:"The front desk is looking…",onSend:k=>{b(k)},onStop:()=>{o.stop()},onChangeModel:i}),d&&l.jsx(Fe,{tone:"error",inline:!0,style:{marginTop:4},children:d})]})]}):l.jsx("aside",{style:{flex:"0 0 auto",borderLeft:"1px solid var(--line)",background:"var(--bg-panel)",display:"flex",flexDirection:"column",alignItems:"center",padding:"var(--sp-2) 4px"},children:l.jsxs("button",{type:"button",onClick:u,title:o.thinking?"The front desk is replying — open it":x?"The front desk answered — open it":"Open the front desk (the same conversation as your phone)","aria-label":"Open the front desk",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8,background:"none",border:0,padding:"6px 4px",cursor:"pointer",color:"var(--ink-2)",borderRadius:"var(--r-sm)",position:"relative"},children:[l.jsx(ie,{name:"chevronLeft",size:14}),l.jsx("span",{style:{writingMode:"vertical-rl",fontSize:"var(--fs-xs)",letterSpacing:".06em",textTransform:"uppercase"},children:"Front desk"}),(x||o.thinking)&&l.jsx("span",{"aria-hidden":!0,style:{position:"absolute",top:4,right:2,width:7,height:7,borderRadius:"50%",background:o.thinking?"var(--ink-2)":"var(--brand)"}})]})})}function h1(i,c){const u=i.activeRun??i.lastRun;return[i.name,i.folder,u?.title,u?.mission].some(o=>o?.toLowerCase().includes(c))}function p1(i){const c=[];for(const u of i){if(Array.isArray(u.needs)){const h=[...u.needs].sort((m,y)=>(m.since??0)-(y.since??0));for(const m of h)c.push({...m,projectId:u.id,projectName:u.name});continue}const o=u.pendingPermissions||0,d=u.pendingQuestions||0;o+d!==0&&c.push({projectId:u.id,projectName:u.name,kind:"summary",text:V0({approvals:o,questions:d,planner:!!u.plannerQuestion})})}return c}async function v1(i){return i.ok?null:(await i.json().catch(()=>({}))).error??(i.status===404?"already answered or timed out":`HTTP ${i.status}`)}function m1(i,c){const[u,o]=g.useState(!1),[d,h]=g.useState(null),[m,y]=g.useState(""),[x,p]=g.useState(null),S=async(w,_)=>{p({state:"running",progress:"Starting git…"});const X=await Se.cloneProject(w,_),M=await X.json().catch(()=>({}));if(!X.ok){p({state:"error",error:M.error??`HTTP ${X.status}`});return}const z=M.id,R=async()=>{const N=await Se.cloneStatus(z).catch(()=>null),Z=N&&N.ok?await N.json():null;if(!Z){p({state:"error",error:"Lost track of the clone. Check the projects root."});return}if(Z.state==="running"){p({state:"running",progress:Z.progress,dest:Z.dest}),setTimeout(()=>{R()},1e3);return}if(Z.state==="error"){p({state:"error",error:Z.error});return}p(null),o(!1),h(null),Z.projectId&&c(Z.projectId)};R()},b=async w=>{y("");const _=await Se.browse(w);_.ok&&h(await _.json())},k=async w=>{if(!d)return;y("");const _=await Se.mkdir(d.path,w);_.ok?await b((await _.json().catch(()=>null))?.path??d.path):y((await _.json()).error)};return{open:u,show:()=>{o(!0),b()},close:()=>{x?.state!=="running"&&(o(!1),h(null),p(null))},props:d&&{path:d.path,parent:d.parent,dirs:d.dirs,error:m,onNavigate:w=>{b(w)},onCreate:w=>{k(w)},onPick:w=>{o(!1),h(null),i(w)},onClone:(w,_)=>{S(w,_)},cloneWhere:w=>Se.cloneWhere(w).then(_=>_.json()),clone:x}}}const Bc={display:"flex",flexDirection:"column",gap:"var(--sp-2)"};function g1({projects:i,connected:c,activity:u,auth:o,onOpen:d,onOpenRun:h,refresh:m,theme:y,onToggleTheme:x,onSettings:p,query:S="",onQuery:b,search:k}){const[w,_]=g.useState(!1),[X,M]=d1(),[z,R]=g.useState(null),[N,Z]=g.useState(null),re=async A=>{const F=await Se.linkProject(A);F.ok&&(m(),d((await F.json()).project.id))},B=Zp(),L=s1(i),P=m1(A=>{re(A)},A=>{m(),d(A)}),G=S.trim().toLowerCase(),ce=G?i.filter(A=>h1(A,G)):i,te=p1(ce),ee=ce.filter(A=>A.activeRun).sort((A,F)=>(F.lastActivityAt??0)-(A.lastActivityAt??0)),xe=ce.filter(A=>!A.activeRun),se=i.filter(A=>A.activeRun).length,me=i.reduce((A,F)=>A+(Array.isArray(F.needs)?F.needs.length:(F.pendingPermissions||0)+(F.pendingQuestions||0)),0),j=se===0&&me===0,q=j&&i.length>0?"all quiet":[se>0?`${se} running`:null,me>0?`${me} needs you`:null].filter(Boolean).join(" · "),O=async A=>{A.preventDefault(),_(!1);const F=A.dataTransfer.items[0]?.webkitGetAsEntry?.();if(!F?.isDirectory)return;R({name:F.name,matches:null});const ne=await Se.locate(F.name);R({name:F.name,matches:ne.ok?(await ne.json()).matches:[]})},ue=async A=>{const F=await v1(await A);return m(),F},he=(A,F)=>ue(Se.permission(A.id,F)),T=(A,F)=>ue(Se.answer(A.id,F)),Q=(A,F)=>ue(fetch("/chat/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectId:A.projectId,id:A.id,answers:{[A.text]:F}})}));return l.jsxs("div",{style:{height:"100%",overflow:"hidden",position:"relative",display:"flex",flexDirection:"column"},onDragOver:A=>{A.preventDefault(),_(!0)},onDragLeave:A=>{A.target===A.currentTarget&&_(!1)},onDrop:A=>{O(A)},children:[w&&l.jsx(l1,{}),l.jsxs(lv,{mode:"fleet",subtitle:"mission control",theme:y,onToggleTheme:x,onSettings:p,search:k,children:[!c&&l.jsx(Fe,{tone:"disconnected",inline:!0,children:"disconnected"}),c&&o.mode==="none"&&l.jsx(Fe,{tone:"caution",inline:!0,children:"No model credentials on this machine, so missions cannot start. Sign in with Claude Code and restart Foreman, or give a project its own API key or endpoint in Settings → Provider."}),q&&l.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:6,padding:"2px 10px",borderRadius:"var(--r-pill)",border:`1px solid ${me>0?"var(--status-warning)":j?"var(--line)":"var(--line-strong)"}`,background:me>0?"var(--brand-wash)":"transparent",fontSize:"var(--fs-xs)",color:j?"var(--ink-3)":"var(--ink-1)",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"},children:q}),i.length>0&&l.jsx(le,{variant:"primary",icon:"add",onClick:P.show,title:"Link a folder as a project (or drop one anywhere on this page)",children:"Link project"})]}),l.jsxs("div",{style:{flex:1,minHeight:0,display:"flex"},children:[l.jsxs("div",{style:{flex:1,minWidth:0,overflowY:"auto",display:"flex",flexDirection:"column"},children:[G&&l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",maxWidth:"var(--fleet-max)",margin:"0 auto",width:"100%",padding:"var(--sp-4) var(--sp-5) 0",boxSizing:"border-box",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:[l.jsxs("span",{children:["Showing projects matching “",S.trim(),"” · ",l.jsxs("span",{style:{fontVariantNumeric:"tabular-nums"},children:[ce.length," of ",i.length]})]}),l.jsx(le,{variant:"ghost",size:"sm",onClick:()=>b?.(""),children:"Show all"})]}),i.length===0?l.jsxs("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--sp-3)",padding:"var(--sp-5)",textAlign:"center"},children:[l.jsx("div",{style:{width:"20rem",maxWidth:"100%"},children:l.jsx(P0,{onClick:P.show})}),l.jsx(Qe,{children:"No projects linked yet — link a folder to give the director a job site."}),l.jsx("div",{style:{width:"32rem",maxWidth:"100%",marginTop:"var(--sp-3)"},children:l.jsx(e1,{load:Se.doctor,onSettings:()=>p("provider"),onInstallBrowser:B.start,install:B.job})})]}):l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-5)",padding:"var(--sp-5)",maxWidth:"var(--fleet-max)",margin:"0 auto",width:"100%",boxSizing:"border-box"},children:[ce.length===0&&l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[l.jsxs(Qe,{children:["No project matches “",S.trim(),"”. Runs that do are in the search box above."]}),l.jsx(le,{variant:"ghost",size:"sm",onClick:()=>b?.(""),children:"Show all"})]}),te.length===0&&ee.length===0&&ce.length>0&&l.jsx(Qe,{children:"All quiet — nothing running, nothing waiting on you. Open a project to plan its next mission."}),te.length>0&&l.jsxs("section",{style:Bc,children:[l.jsxs(pn,{children:["Needs you · ",te.length]}),l.jsx(X0,{items:te,onPermission:he,onAnswer:T,onPlanner:Q,onOpen:d})]}),ee.length>0&&l.jsxs("section",{style:Bc,children:[l.jsxs(pn,{children:["Running · ",ee.length]}),l.jsx("div",{style:{background:"var(--bg-card)",border:"1px solid var(--line)",borderRadius:"var(--r-md)",overflow:"hidden"},children:ee.map((A,F)=>{const ne=A.activeRun;return l.jsx(F0,{name:A.name,folder:A.folder,title:ne.title,mission:ne.mission,activity:u[A.id],costUsd:ne.costUsd,budgetUsd:ne.budgetUsd,costBasis:ga(ne),usage:ne.usage,turns:ne.turns,directorModel:ne.directorModel,workerModel:ne.workerModel,createdAt:ne.createdAt,onOpen:()=>d(A.id),style:F>0?{borderTop:"1px solid var(--line)"}:void 0},A.id)})})]}),xe.length>0&&l.jsxs("section",{style:Bc,children:[l.jsxs(pn,{children:["Recent · ",xe.length]}),l.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:"var(--sp-3)"},children:xe.map(A=>{const F=c1(L[A.id]);return l.jsxs("div",{style:{position:"relative",display:"flex",minWidth:0},children:[l.jsx(I0,{name:A.name,folder:A.folder,style:{flex:1,minWidth:0},lastRun:A.lastRun&&A.lastRun.status!=="idle"&&A.lastRun.status!=="running"?A.lastRun:null,onOpen:()=>{const ne=A.lastRun;ne?.id&&h&&(ne.status==="error"||ne.status==="interrupted")?h(A.id,ne.id):d(A.id)},onUnlink:()=>Z(A)}),F&&l.jsx(u1,{clock:F})]},A.id)})})]})]})]}),i.length>0&&l.jsx(f1,{onSettings:p,open:X,onToggle:M})]}),P.open&&P.props&&l.jsx(n1,{...P.props,onClose:P.close}),z&&l.jsx(a1,{name:z.name,matches:z.matches,onPick:A=>{R(null),re(A)},onClose:()=>R(null)}),N&&l.jsx(rv,{title:`Unlink ${N.name}?`,body:"Foreman stops tracking this folder. Run history and its .foreman/ files stay on disk; you can link it again later.",confirmLabel:"Unlink",tone:"danger",icon:"unlink",onConfirm:()=>{const A=N.id;Z(null),Se.unlinkProject(A).then(m)},onCancel:()=>Z(null)})]})}const bp=["Welcome","Where missions run","Your phone","Reach & browser","Ready"],y1={ok:{icon:"done",color:"var(--status-good)"},warn:{icon:"caution",color:"var(--status-serious)"},none:{icon:"idle",color:"var(--ink-2)"}};function pt({tone:i,title:c,children:u}){const o=y1[i];return l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"20px minmax(0, 1fr)",columnGap:"var(--sp-2)",padding:"var(--sp-2) 0",borderTop:"1px solid var(--line)"},children:[l.jsx(ie,{name:o.icon,size:16,color:o.color,style:{marginTop:2}}),l.jsxs("div",{style:{minWidth:0},children:[l.jsx("div",{style:{color:"var(--ink-0)",fontWeight:"var(--fw-semibold)"},children:c}),u&&l.jsx("div",{style:{color:"var(--ink-1)",marginTop:2,lineHeight:"var(--lh)"},children:u})]})]})}function It({children:i}){return l.jsx("code",{style:{fontFamily:"var(--font-mono)",fontSize:"0.92em",background:"var(--bg-inset)",padding:"1px 5px",borderRadius:"var(--r-xs, 3px)"},children:i})}function x1({onDone:i,onSettings:c}){const[u,o]=g.useState(0),[d,h]=g.useState(null),[m,y]=g.useState(!1),[x,p]=g.useState(null),S=async()=>{y(!0),p(null);try{const M=await Se.doctor();if(!M.ok)throw new Error(`HTTP ${M.status}`);h(await M.json())}catch(M){p(M instanceof Error?M.message:String(M))}finally{y(!1)}};g.useEffect(()=>{S()},[]),g.useEffect(()=>{u>0&&S()},[u]);const b=Zp(()=>{S()}),k=b.job?.state==="running",w=d?d.auth.mode==="none"&&!d.ollama&&!d.codex:!1,_=u===bp.length-1,X=()=>{if(u===0)return l.jsxs(l.Fragment,{children:[l.jsx("h1",{style:Hi,children:"Foreman runs missions on your projects."}),l.jsx("p",{style:Al,children:"You link a folder, talk over what should happen with a planner that reads the code and never changes it, and start a mission with a budget. A director plans the work, hires workers, verifies what they did and stops at the cap. You approve what matters — from here or from your phone — and read the result: the files that changed, the screenshots, the branch, a pull request when you want one."}),l.jsx("p",{style:Al,children:"The next four pages show what this machine has for that. Nothing on them is required; anything missing says how to get it."})]});if(!d)return l.jsx("p",{style:Al,children:x?`Could not read this machine: ${x}`:"Reading this machine…"});if(u===1){const z=d.auth;return l.jsxs(l.Fragment,{children:[l.jsx("h1",{style:Hi,children:w?"Nothing to run missions on yet.":"Where missions run."}),l.jsx("p",{style:Al,children:"Missions run through a model provider. By default that is the Claude Code install on this machine, and whoever it is signed in as pays. A project can also have a provider of its own."}),l.jsxs("div",{children:[z.mode==="subscription"&&l.jsxs(pt,{tone:"ok",title:`Claude Code is signed in${z.account?.email?` as ${z.account.email}`:""}`,children:["Missions bill that subscription",z.account?.org?` (${z.account.org})`:"",". Source: ",l.jsx(It,{children:z.source}),"."]}),z.mode==="api-key"&&l.jsxs(pt,{tone:"ok",title:"An Anthropic API key is set in the environment",children:["Missions bill that key, per token. Source: ",l.jsx(It,{children:z.source}),"."]}),z.mode==="cloud"&&l.jsx(pt,{tone:"ok",title:`Claude through ${z.source}`,children:"Missions bill that cloud account."}),z.mode==="none"&&l.jsxs(pt,{tone:"warn",title:"Claude Code is not signed in on this machine",children:["Until it is, or a project gets a provider of its own, nothing can run. Three ways forward:",l.jsxs("ol",{style:{margin:"var(--sp-2) 0 0",paddingLeft:"1.2em",display:"flex",flexDirection:"column",gap:4},children:[l.jsxs("li",{children:["In a terminal, run ",l.jsx(It,{children:"claude"}),", then ",l.jsx(It,{children:"/login"}),". Restart Foreman and press ",l.jsx("em",{children:"Check again"}),"."]}),l.jsxs("li",{children:["Start Foreman with ",l.jsx(It,{children:"ANTHROPIC_API_KEY"})," set. The key is billed per token."]}),l.jsx("li",{children:"Link a project, then give it an Anthropic API key, a Codex login or any OpenAI-compatible endpoint in Settings → Provider."})]})]}),d.ollama&&l.jsxs(pt,{tone:"ok",title:`Ollama is running with ${d.ollama.models} model${d.ollama.models===1?"":"s"}`,children:[d.ollama.local," served from this machine at no cost per token; the rest are cloud models Ollama proxies. They appear in every model picker."]}),d.codex&&l.jsx(pt,{tone:"ok",title:`Codex is signed in, ${d.codex.models} model${d.codex.models===1?"":"s"}`,children:"Runs on the ChatGPT subscription. In every model picker as well."}),!d.ollama&&!d.codex&&z.mode!=="none"&&l.jsx(pt,{tone:"none",title:"No local Ollama or Codex",children:"Not needed. If either is installed later, its models show up in the pickers on their own."})]})]})}if(u===2){const z=d.phone;return l.jsxs(l.Fragment,{children:[l.jsx("h1",{style:Hi,children:"Your phone."}),l.jsx("p",{style:Al,children:"Foreman can reach you on Telegram: an approval to tap, a question to answer, a mission that finished, a budget alert. From there you can also talk to the front desk and start planning. Optional, and the bot token is only ever typed into Settings."}),l.jsxs("div",{children:[z?.label&&l.jsxs(pt,{tone:"ok",title:`Linked to ${z.label}`,children:["Through ",z.bot?l.jsxs(It,{children:["@",z.bot.replace(/^@/,"")]}):"your bot","."]}),z&&!z.label&&l.jsxs(pt,{tone:"warn",title:"A bot is configured but no chat is linked yet",children:["Send it ",l.jsx(It,{children:"/start"})," from your phone to link this chat."]}),!z&&l.jsxs(pt,{tone:"none",title:"Not set up",children:["Create a bot with @BotFather, paste its token in Settings → Notifications, then send it ",l.jsx(It,{children:"/start"}),"."]})]}),l.jsx("div",{children:l.jsx(le,{variant:"ghost",size:"sm",icon:"needsYou",onClick:()=>c("notifications"),children:"Settings → Notifications"})})]})}if(u===3){const z=d.tailnet,R=d.browser;return l.jsxs(l.Fragment,{children:[l.jsx("h1",{style:Hi,children:"Reach, and a browser for the crew."}),l.jsxs("div",{children:[z?l.jsxs(pt,{tone:"ok",title:`On a tailnet: ${z.dnsName??z.ip}`,children:["The dashboard is also at ",l.jsx(It,{children:z.url}),z.https?", over HTTPS":"",". Phone links open there.",!z.https&&l.jsxs(l.Fragment,{children:[" For HTTPS, ",l.jsx(It,{children:"tailscale serve"})," can front it; Foreman never opens a Funnel."]})]}):l.jsx(pt,{tone:"none",title:"This machine only",children:"The dashboard listens on localhost. With Tailscale installed it also listens on the tailnet, so the phone can open links; nothing is ever exposed to the internet."}),R&&l.jsxs(pt,{tone:R.status==="ok"?"ok":"warn",title:R.status==="ok"?"A browser for missions":/install-deps/.test(R.fix??"")?"A browser is installed, but it cannot start here":"No browser for missions",children:[R.detail,R.status!=="ok"&&R.fix&&/install-deps/.test(R.fix)&&l.jsxs(l.Fragment,{children:[l.jsx("br",{}),R.fix,l.jsx("br",{}),"That is the one step Foreman will not do for you: it never runs anything as root. Once the libraries are in, press ",l.jsx("em",{children:"Check again"}),". Missions that do not need a browser are unaffected."]}),R.status!=="ok"&&!/install-deps/.test(R.fix??"")&&l.jsxs(l.Fragment,{children:[l.jsx("br",{}),"Missions that do not need a browser are unaffected. Foreman can install Playwright's own Chromium for you — about 150 MB, into your home directory, no administrator rights.",l.jsxs("div",{style:{marginTop:"var(--sp-2)",display:"flex",alignItems:"center",gap:"var(--sp-2)",flexWrap:"wrap"},children:[l.jsx(le,{variant:"primary",size:"sm",icon:b.job?.state==="running"?"loading":"add",disabled:b.job?.state==="running",onClick:b.start,children:b.job?.state==="running"?"Installing…":"Install Playwright Chromium"}),b.job&&l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:b.job.state==="error"?"var(--status-critical)":"var(--ink-2)",fontFamily:"var(--font-mono)"},children:b.job.state==="error"?b.job.error:b.job.progress})]})]})]})]})]})}const M=d.auth;return l.jsxs(l.Fragment,{children:[l.jsx("h1",{style:Hi,children:w?"Set up, minus a provider.":"Ready."}),l.jsxs("div",{children:[l.jsxs(pt,{tone:M.mode==="none"?(d.ollama||d.codex,"warn"):"ok",title:"Missions run on",children:[M.mode==="none"?"nothing yet — see page 2":M.mode==="subscription"?`Claude Code${M.account?.email?`, ${M.account.email}`:""}`:M.mode==="api-key"?"an Anthropic API key":M.source,d.ollama?` · Ollama, ${d.ollama.models} models`:"",d.codex?" · Codex":""]}),l.jsx(pt,{tone:d.phone?.label?"ok":"none",title:"Phone",children:d.phone?.label?`Telegram, ${d.phone.label}`:"not linked"}),l.jsx(pt,{tone:d.tailnet?"ok":"none",title:"Reach",children:d.tailnet?`localhost and ${d.tailnet.dnsName??d.tailnet.ip}`:"localhost"}),l.jsx(pt,{tone:d.browser?.status==="ok"?"ok":"warn",title:"Browser",children:d.browser?.status==="ok"?"found":"none — browser missions will fail"})]}),l.jsxs("p",{style:Al,children:["Next: link a project — a folder on this machine, or a Git URL to clone. The fleet page has the card; dropping a folder anywhere on it works too. This walk-through is at ",l.jsx(It,{children:"#/setup"})," whenever you want it, and ",l.jsx(It,{children:"foreman doctor"})," says the same in a terminal."]})]})};return l.jsx("div",{style:{height:"100%",overflowY:"auto",background:"var(--bg-app)",display:"flex",flexDirection:"column"},children:l.jsxs("div",{style:{width:"100%",maxWidth:"44rem",margin:"0 auto",padding:"56px var(--sp-4) 40px",boxSizing:"border-box",display:"flex",flexDirection:"column",gap:"var(--sp-4)",flex:1},children:[l.jsxs("header",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[l.jsx("span",{style:{fontWeight:"var(--fw-semibold)"},children:"Foreman"}),l.jsxs("span",{style:{color:"var(--ink-2)",fontSize:"var(--fs-sm)"},children:["first run",d?.version?` · v${d.version}`:""]}),l.jsx("span",{style:{flex:1}}),l.jsx(le,{variant:"ghost",size:"sm",disabled:k,onClick:i,children:"Skip to the fleet"})]}),l.jsx("ol",{style:{listStyle:"none",margin:0,padding:0,display:"flex",gap:"var(--sp-2)",flexWrap:"wrap"},children:bp.map((M,z)=>{const R=z<u?"done":z===u?"now":"todo";return l.jsx("li",{children:l.jsxs("button",{type:"button",onClick:()=>z<u&&o(z),disabled:z>u,style:{display:"inline-flex",alignItems:"center",gap:6,background:"none",border:"none",padding:"4px 6px",font:"inherit",fontSize:"var(--fs-sm)",cursor:z<u?"pointer":"default",color:R==="now"?"var(--ink-0)":R==="done"?"var(--ink-1)":"var(--ink-2)",fontWeight:R==="now"?"var(--fw-semibold)":"inherit"},children:[l.jsx("span",{style:{width:18,height:18,borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"var(--fs-xs)",fontVariantNumeric:"tabular-nums",background:R==="now"?"var(--brand)":R==="done"?"var(--status-good)":"transparent",color:R==="todo"?"var(--ink-2)":"var(--brand-ink)",border:R==="todo"?"1px solid var(--line-strong)":"1px solid transparent"},children:R==="done"?l.jsx(ie,{name:"done",size:11}):z+1}),M]})},M)})}),l.jsx("section",{style:{background:"var(--bg-card)",border:"1px solid var(--line)",borderRadius:"var(--r-md)",padding:"var(--sp-5)",display:"flex",flexDirection:"column",gap:"var(--sp-3)",fontSize:"var(--fs-md, var(--fs-sm))"},children:X()}),l.jsxs("footer",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[u>0&&l.jsx(le,{variant:"ghost",icon:"back",disabled:k,onClick:()=>o(u-1),children:"Back"}),l.jsx("span",{style:{flex:1}}),k&&l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:"Installing — stay on this page"}),u>0&&l.jsx(le,{variant:"ghost",icon:m?"loading":"resume",disabled:m||k,onClick:()=>{S()},children:"Check again"}),_?l.jsx(le,{variant:"primary",icon:"add",disabled:k,onClick:i,children:"Go link a project"}):l.jsx(le,{variant:"primary",disabled:k,onClick:()=>o(u+1),children:u===0?"Show me":u===1&&w?"Continue without a provider":"Continue"})]})]})})}const Hi={margin:0,fontSize:"var(--fs-xl, 1.35rem)",fontWeight:"var(--fw-semibold)",lineHeight:1.25,textWrap:"balance"},Al={margin:0,color:"var(--ink-1)",lineHeight:"var(--lh)",maxWidth:"62ch"},b1=15e3;function j1(i,c){const[u,o]=g.useState(null),[d,h]=g.useState(!1),[m,y]=g.useState(null),[x,p]=g.useState(!1),[S,b]=g.useState(0),k=g.useCallback(()=>b(w=>w+1),[]);return g.useEffect(()=>{if(o(null),y(null),p(!1),!i){h(!1);return}let w=!1;h(!0);const _=async()=>{const M=await fetch(`/runs/${encodeURIComponent(i)}/deck`).catch(()=>null);if(w)return;if(!M){y("Could not reach the server."),h(!1);return}if(M.status===404){p(!0),y(null),h(!1);return}if(!M.ok){const R=await M.json().catch(()=>({}));y(R.error||`HTTP ${M.status}`),h(!1);return}const z=await M.json().catch(()=>null);w||(z&&(o(z),p(!1),y(null)),h(!1))};_();const X=c?setInterval(()=>{_()},b1):null;return()=>{w=!0,X&&clearInterval(X)}},[i,c,S]),{deck:u,loading:d,error:m,missing:x,refresh:k}}function S1(i,c=null){const[u,o]=g.useState([]),[d,h]=g.useState(!1),[m,y]=g.useState(!1),[x,p]=g.useState(null),[S,b]=g.useState(0),k=g.useCallback(()=>b(w=>w+1),[]);return g.useEffect(()=>{if(o([]),p(null),!i){y(!1);return}let w=!1;return y(!0),fetch(`/projects/${encodeURIComponent(i)}/tree`).then(async _=>{if(w)return;if(!_.ok){p((await _.json().catch(()=>({}))).error||`HTTP ${_.status}`);return}const X=await _.json();o(X.files??[]),h(!!X.truncated)}).catch(()=>{w||p("Could not reach the server.")}).finally(()=>{w||y(!1)}),()=>{w=!0}},[i,S,c]),{files:u,truncated:d,loading:m,error:x,refresh:k}}const ru=g.forwardRef(function({value:c,onChange:u,placeholder:o,size:d="mission",bare:h,onKeyDown:m,onPaste:y,onFocus:x,onBlur:p,style:S},b){const k=d==="mission";return l.jsx("textarea",{ref:b,value:c,placeholder:o,onKeyDown:m,onPaste:y,onFocus:x,onBlur:p,onChange:w=>u?.(w.target.value),style:{width:"100%",boxSizing:"border-box",display:"block",minHeight:k?180:void 0,height:k?void 0:56,resize:"vertical",background:h?"transparent":k?"var(--bg-card)":"var(--bg-inset)",border:h?"none":"1px solid var(--line-strong)",outline:h?"none":void 0,borderRadius:h?0:k?"var(--r-md)":"var(--r-sm)",padding:k?"var(--sp-3)":"var(--sp-2)",color:"var(--ink-0)",lineHeight:k?"var(--lh-prose)":"var(--lh)",...S}})});function ur(i){return new Date(i).toLocaleTimeString(void 0,{hour12:!1})}const $c=[1,5,15,30,60,120,300,600,900,1800,3600,7200,21600].map(i=>i*1e3);function k1(i,c){const u=c-i,o=$c.find(h=>u/h<=6)??$c[$c.length-1],d=[];for(let h=Math.ceil(i/o)*o;h<c;h+=o)d.push(h);return{marks:d,step:o}}function w1({agents:i=[],entries:c=[],live:u,selected:o,onSelect:d,onTick:h,height:m=22,style:y}){if(!c.length)return null;const x=Math.min(...c.map(M=>M.ts)),p=Math.max(...c.map(M=>M.ts)),S=u?Math.min(Math.max(Date.now(),p),p+6e4):p,b=Math.max(S-x,1e3),k=M=>`${(M-x)/b*100}%`,w=M=>(M-x)/b*100,{marks:_}=k1(x,x+b),X=i.length?i.map(M=>M.id??M):[...new Set(c.map(M=>M.agent))];return l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"84px 1fr",rowGap:4,columnGap:10,fontSize:"var(--fs-xs)",color:"var(--ink-2)",...y},children:[X.map(M=>{const z=c.filter(B=>B.agent===M);if(!z.length)return null;const R=Math.min(...z.map(B=>B.ts)),N=i.find(B=>(B.id??B)===M)?.status,Z=N==="running"&&u?S:Math.max(...z.map(B=>B.ts)),re=o&&o!==M;return l.jsxs(vn.Fragment,{children:[l.jsxs("button",{type:"button",onClick:()=>d?.(M),title:`Filter transcript to ${M}`,style:{display:"flex",alignItems:"center",gap:6,background:"none",border:"none",padding:0,cursor:d?"pointer":"default",color:re?"var(--ink-2)":"var(--ink-1)",font:"inherit",textAlign:"left",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[l.jsx(mn,{agent:M,size:"sm"}),M]}),l.jsxs("div",{style:{position:"relative",height:m,background:"var(--bg-inset)",borderRadius:4,opacity:re?.45:1,overflow:"hidden"},children:[_.map(B=>l.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:k(B),top:0,bottom:0,width:1,background:"var(--line)",opacity:.9}},B)),l.jsx("div",{style:{position:"absolute",left:k(R),width:`calc(${k(Z)} - ${k(R)})`,top:6,bottom:6,minWidth:3,background:vr(M),opacity:.15,borderRadius:3}}),z.map(B=>{const L=l.jsx("span",{style:{display:"block",width:B.kind==="text"?3:2,height:B.kind==="text"?m-6:m-14,borderRadius:1,background:B.kind==="error"?"var(--status-critical)":B.kind==="tool"?"var(--ink-0)":vr(M),boxShadow:"0 0 0 1px var(--bg-inset)"}}),P=`${ur(B.ts)} · ${B.title||B.kind}`;return h?l.jsx("button",{type:"button",title:P,"aria-label":`Jump to ${P}`,onClick:()=>h(B),style:{position:"absolute",left:k(B.ts),top:0,bottom:0,width:9,marginLeft:-4,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:0,cursor:"pointer"},children:L},B.id??B.ts):l.jsx("span",{title:P,style:{position:"absolute",left:k(B.ts),top:B.kind==="text"?3:7,marginLeft:-1},children:L},B.id??B.ts)}),u&&N==="running"&&l.jsx("span",{className:"pulse",style:{position:"absolute",right:0,top:0,bottom:0,width:2,background:"var(--status-good)"}})]})]},M)}),l.jsx("span",{}),l.jsxs("div",{style:{position:"relative",height:16,fontVariantNumeric:"tabular-nums"},children:[l.jsx("span",{style:{position:"absolute",left:0,top:0},children:ur(x)}),_.map(M=>{const z=w(M);return z<12||z>88?null:l.jsx("span",{style:{position:"absolute",left:`${z}%`,top:0,transform:"translateX(-50%)",color:"var(--ink-3, var(--ink-2))"},children:ur(M)},M)}),l.jsx("span",{style:{position:"absolute",right:0,top:0},children:u?"now":ur(S)})]})]})}function z1(i){const c=[];let u=!1;for(const o of String(i||"").split(`
|
|
28
|
+
`)){const d=/^#{1,6}\s+(.*)$/.exec(o.trim());if(d){u=/^DONE\s*WHEN/i.test(d[1]);continue}if(u)continue;const h=/^\s*[-*]\s*\[([ xX])\]\s*(.+)$/.exec(o);h&&c.push({done:h[1]!==" ",text:h[2].trim()})}return c}function C1({doc:i,style:c}){const[u,o]=g.useState(!1),d=i?z1(i):[],h=d.filter(m=>m.done).length;return l.jsxs("section",{style:c,children:[l.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--sp-2)"},children:[l.jsx(pn,{children:"Plan"}),d.length>0&&l.jsxs("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontVariantNumeric:"tabular-nums"},children:[h,"/",d.length]}),i&&l.jsxs("button",{type:"button",onClick:()=>o(!u),style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:4,background:"none",border:"none",cursor:"pointer",color:"var(--ink-2)",fontSize:"var(--fs-xs)",padding:0,font:"inherit"},children:[l.jsx(ie,{name:"raw",size:12}),u?"board":"raw doc"]})]}),d.length>0&&!u&&l.jsx("div",{style:{height:3,background:"var(--bg-inset)",borderRadius:2,marginBottom:6,overflow:"hidden"},children:l.jsx("div",{style:{width:`${h/d.length*100}%`,height:"100%",background:"var(--status-good)",transition:"width var(--dur-meter)"}})}),!i&&l.jsx(Qe,{children:"MISSION.md not written yet."}),i&&!u&&d.map((m,y)=>l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"var(--sp-2)",padding:"4px 0",fontSize:"var(--fs-sm)",color:m.done?"var(--ink-2)":"var(--ink-0)"},children:[l.jsx(ie,{name:m.done?"done":"idle",size:14,strokeWidth:2,color:m.done?"var(--status-good)":"var(--ink-2)",style:{marginTop:2}}),l.jsx("span",{style:{textDecoration:m.done?"line-through":"none"},children:m.text})]},y)),i&&u&&l.jsx("pre",{style:{fontSize:"var(--fs-xs)",whiteSpace:"pre-wrap",color:"var(--ink-1)",background:"var(--bg-inset)",borderRadius:"var(--r-sm)",padding:"var(--sp-2)",maxHeight:320,overflowY:"auto",fontFamily:"var(--font-mono)",margin:0},children:i})]})}function vt({label:i,hint:c,layout:u="inline",children:o,style:d}){return u==="stacked"?l.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:5,...d},children:[l.jsx("span",{style:{fontSize:"var(--fs-xs)",fontWeight:"var(--fw-semibold)",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--ink-2)"},children:i}),o,c&&l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:c})]}):l.jsxs("label",{title:c,style:{display:"flex",alignItems:"center",gap:6,color:"var(--ink-1)",fontSize:"var(--fs-sm)",...d},children:[i,o]})}const T1=/(`[^`\n]+`|<[^<>\n]{1,80}>)/g;function M1(i){const c=[];let u=!1;for(const o of i.split(`
|
|
29
|
+
`)){if(/^```/.test(o)){c.push({text:o,kind:"fence",open:!u}),u=!u;continue}if(u){c.push({text:o,kind:"code"});continue}/^>\s?/.test(o)?c.push({text:o,kind:"quote"}):/^\s*[-*]\s+/.test(o)?c.push({text:o,kind:"list"}):/^#{1,3}\s/.test(o)?c.push({text:o,kind:"heading"}):c.push({text:o,kind:"text"})}return c}function dr(i){return i.split(T1).filter(Boolean).map((c,u)=>c.length>2&&c.startsWith("`")&&c.endsWith("`")?l.jsxs("span",{style:{background:"var(--bg-inset)",boxShadow:"0 0 0 1px var(--line)",borderRadius:3,color:"var(--agent-worker)"},children:[l.jsx("span",{style:{color:"var(--ink-2)"},children:"`"}),c.slice(1,-1),l.jsx("span",{style:{color:"var(--ink-2)"},children:"`"})]},u):c.startsWith("<")&&c.endsWith(">")?l.jsx("span",{style:{background:"var(--brand-wash-strong)",boxShadow:"0 0 0 1px var(--brand)",borderRadius:3},children:c},u):c)}const Bi="var(--sp-3)",E1=g.forwardRef(function({value:c,onChange:u,placeholder:o,minHeight:d=200,maxHeight:h=460,onKeyDown:m,onPaste:y,onFocus:x,onBlur:p,style:S},b){const k=g.useRef(null),w=g.useRef(null);g.useImperativeHandle(b,()=>k.current),g.useEffect(()=>{const z=k.current;z&&(z.style.height="0px",z.style.height=`${Math.max(z.scrollHeight,d)}px`,w.current!=null&&(z.setSelectionRange(w.current,w.current),w.current=null))},[c,d]);const _=z=>{const R=z.target;let N=R.value,Z=R.selectionStart;const re=z.nativeEvent?.inputType==="insertText"&&z.nativeEvent?.data==="`",B=N.slice(0,Z),L=N.slice(Z),P=B.lastIndexOf(`
|
|
30
|
+
`)+1;if(re&&B.slice(P)==="```"&&(L===""||L.startsWith(`
|
|
31
|
+
`))){const G=(B.match(/^```/gm)||[]).length%2===1;G&&(L.match(/^```/gm)||[]).length%2===0?(N=`${B}
|
|
32
|
+
|
|
33
|
+
\`\`\`
|
|
34
|
+
${L.replace(/^\n/,"")}`,Z+=1):G||(N=L.startsWith(`
|
|
35
|
+
`)?N:`${B}
|
|
36
|
+
${L}`,Z+=1),w.current=Z}u?.(N)},X=M1(c||""),M={margin:0,padding:Bi,boxSizing:"border-box",width:"100%",font:"inherit",fontSize:"inherit",lineHeight:"var(--lh-prose)",whiteSpace:"pre-wrap",overflowWrap:"break-word",wordBreak:"break-word",tabSize:4};return l.jsxs("div",{style:{position:"relative",overflowY:"auto",maxHeight:h,...S},children:[l.jsxs("div",{"aria-hidden":!0,style:{...M,position:"absolute",inset:0,height:"auto",color:"var(--ink-0)",pointerEvents:"none"},children:[!c&&o&&l.jsx("div",{style:{color:"var(--ink-2)"},children:o}),c&&X.map((z,R)=>{const N=z.kind==="code"||z.kind==="fence";return l.jsx("div",{style:{...N?{background:"var(--bg-inset)",margin:`0 calc(-0.5 * ${Bi})`,padding:`0 calc(0.5 * ${Bi})`}:null,...z.kind==="fence"?{borderRadius:z.open?"6px 6px 0 0":"0 0 6px 6px"}:null,...z.kind==="quote"?{color:"var(--ink-1)",boxShadow:"inset 2px 0 0 var(--agent-worker)",margin:`0 calc(-1 * ${Bi})`,padding:`0 ${Bi}`}:null,...z.kind==="fence"?{color:"var(--ink-2)"}:null,...z.kind==="code"?{color:"var(--ink-1)"}:null},children:z.text===""?"":z.kind==="fence"?l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{color:"transparent"},children:"```"}),z.text.slice(3)]}):z.kind==="code"?z.text:z.kind==="list"?l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{color:"var(--brand)"},children:/^\s*[-*]\s+/.exec(z.text)[0]}),dr(z.text.replace(/^\s*[-*]\s+/,""))]}):z.kind==="heading"?l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{color:"var(--brand)"},children:/^#{1,3}\s/.exec(z.text)[0]}),dr(z.text.replace(/^#{1,3}\s/,""))]}):z.kind==="quote"?l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{color:"var(--ink-2)"},children:/^>\s?/.exec(z.text)[0]}),dr(z.text.replace(/^>\s?/,""))]}):dr(z.text)},R)})]}),l.jsx("textarea",{ref:k,value:c,onChange:_,spellCheck:!1,onKeyDown:m,onPaste:y,onFocus:x,onBlur:p,style:{...M,position:"relative",display:"block",minHeight:d,resize:"none",overflow:"hidden",background:"transparent",border:"none",outline:"none",color:"transparent",caretColor:"var(--ink-0)"}})]})}),_1=[{id:"fable",label:"Fable",model:"claude-fable-5",cost:4,note:"Frontier. Long-horizon planning and verification."},{id:"opus",label:"Opus",model:"claude-opus-5",cost:3,note:"Deep reasoning for hard refactors."},{id:"sonnet",label:"Sonnet",model:"claude-sonnet-5",cost:2,note:"Balanced. The usual worker."},{id:"haiku",label:"Haiku",model:"claude-haiku-4-5",cost:1,note:"Fast and cheap for reads and mechanical edits."}],jp={id:"",label:"Default",model:"inherits your Claude Code default",cost:0};function D1(i){const[c,u]=g.useState({models:null,loading:!!i,error:null});return g.useEffect(()=>{if(!i)return;let o=!0;return u(h=>({...h,loading:!0})),(typeof i=="string"?fetch(i).then(h=>{if(!h.ok)throw new Error(`${h.status} from ${i}`);return h.json()}).then(h=>h.models||h):Promise.resolve().then(i)).then(h=>o&&u({models:h,loading:!1,error:null})).catch(h=>o&&u({models:null,loading:!1,error:String(h&&h.message||h)})),()=>{o=!1}},[i]),c}function A1({cost:i}){return i?l.jsx("span",{"aria-label":`cost ${i} of 4`,style:{display:"inline-flex",gap:2},children:[1,2,3,4].map(c=>l.jsx("span",{style:{width:4,height:10,borderRadius:1,background:c<=i?"var(--ink-1)":"var(--line-strong)"}},c))}):l.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:"—"})}function ov(i){return i&&i.providerLabel||"Anthropic"}function R1(i){const c=[];for(const u of i){const o=ov(u);let d=c.find(h=>h.label===o);d||(d={label:o,items:[]},c.push(d)),d.items.push(u)}return c}function $t({align:i="left",block:c=!1,value:u="",onChange:o,models:d,loading:h,note:m,inheritNote:y,allowDefault:x=!0,disabled:p,style:S}){const[b,k]=g.useState(!1),[w,_]=g.useState(null),[X,M]=g.useState(""),z=g.useRef(null),R=g.useRef(null),N=g.useRef(null),Z=y?{...jp,model:y}:jp,re=d||_1,B=[...x?[Z]:[],...re],L=B.find(q=>q.id===u)||(u?{id:u,label:u,model:u}:Z),P=re.length>6,G=X.trim().toLowerCase(),ce=q=>!G||[q.label,q.model,q.id,q.providerLabel,q.note,q.record].some(O=>String(O??"").toLowerCase().includes(G)),te=P&&G?re.filter(ce):re,ee=R1(te),xe=ee.length>1;g.useEffect(()=>{if(!b)return;const q=ue=>{z.current&&!z.current.contains(ue.target)&&k(!1)},O=ue=>{ue.key==="Escape"&&k(!1)};return document.addEventListener("mousedown",q),document.addEventListener("keydown",O),()=>{document.removeEventListener("mousedown",q),document.removeEventListener("keydown",O)}},[b]),g.useEffect(()=>{if(!b||!R.current)return;const q=R.current.querySelector('[data-selected="true"]');q&&q.scrollIntoView({block:"nearest"})},[b]),g.useEffect(()=>{if(!b){M("");return}N.current?.focus()},[b]);const se=()=>{const q=ee[0]?.items[0];q&&(o?.(q.id,q),k(!1))},me=ov(L),j=L.id&&me!=="Anthropic";return l.jsxs("div",{ref:z,style:{position:"relative",display:c?"block":"inline-block",...c?{width:"100%"}:{},...S},children:[l.jsxs("button",{type:"button",disabled:p||h,onClick:()=>k(q=>!q),"aria-haspopup":"listbox","aria-expanded":b,style:{display:c?"flex":"inline-flex",alignItems:"center",gap:8,minWidth:150,padding:"6px 8px 6px 10px",...c?{width:"100%",boxSizing:"border-box"}:{},background:"var(--bg-card)",border:`1px solid ${b?"var(--ink-2)":"var(--line-strong)"}`,borderRadius:"var(--r-sm)",color:h?"var(--ink-2)":"var(--ink-0)",cursor:p||h?"default":"pointer",textAlign:"left",transition:"border-color var(--dur-fast) var(--ease)"},children:[l.jsx(ie,{name:h?"loading":"model",size:14,color:"var(--ink-2)"}),l.jsxs("span",{style:{flex:1,display:"inline-flex",alignItems:"center",gap:6,minWidth:0},children:[l.jsx("span",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:h?"Fetching models…":L.label}),j&&l.jsx("span",{style:{flex:"0 0 auto",fontSize:"var(--fs-xs)",lineHeight:1,padding:"2px 5px",borderRadius:"var(--r-xs, 3px)",background:"var(--bg-hover)",color:"var(--ink-2)",border:"1px solid var(--line)"},children:me})]}),l.jsx(ie,{name:"chevronDown",size:14,color:"var(--ink-2)"})]}),b&&l.jsxs("div",{role:"listbox",style:{position:"absolute",top:"calc(100% + 4px)",zIndex:20,minWidth:300,...c?{left:0,right:0}:i==="right"?{right:0}:{left:0},background:"var(--bg-panel)",border:"1px solid var(--line-strong)",borderRadius:"var(--r-sm)",boxShadow:"0 8px 24px rgba(0,0,0,0.28)",padding:4,display:"flex",flexDirection:"column"},children:[m&&l.jsx("div",{style:{padding:"6px 10px",fontSize:"var(--fs-xs)",color:"var(--ink-2)",borderBottom:B.length?"1px solid var(--line)":"none"},children:m}),P&&l.jsx("div",{style:{padding:6,borderBottom:"1px solid var(--line)"},children:l.jsx("input",{ref:N,value:X,onChange:q=>M(q.target.value),placeholder:`Filter ${re.length} models…`,"aria-label":"Filter models",onKeyDown:q=>{q.key==="Enter"&&(q.preventDefault(),se())},style:{width:"100%",boxSizing:"border-box",padding:"5px 8px",font:"inherit",fontSize:"var(--fs-sm)",color:"var(--ink-0)",background:"var(--bg-inset)",border:"1px solid var(--line)",borderRadius:"var(--r-sm)",outline:"none"}})}),l.jsxs("div",{ref:R,style:{maxHeight:360,overflowY:"auto",display:"flex",flexDirection:"column"},children:[P&&G&&te.length===0&&l.jsxs("div",{style:{padding:"10px",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:["No model matches “",X.trim(),"”."]}),x&&!G&&l.jsx(Sp,{m:Z,selected:L.id===Z.id,hover:w===Z.id,onHover:_,onClick:()=>{o?.(Z.id,Z),k(!1)}},Z.id),ee.map(q=>l.jsxs(vn.Fragment,{children:[xe&&l.jsxs("div",{style:{padding:"6px 8px 4px",marginTop:2,fontSize:"var(--fs-xs)",fontWeight:"var(--fw-semibold)",color:"var(--ink-2)",textTransform:"uppercase",letterSpacing:"0.04em",display:"flex",justifyContent:"space-between",position:"sticky",top:0,background:"var(--bg-panel)",zIndex:1},children:[l.jsx("span",{children:q.label}),l.jsx("span",{children:q.items.length})]}),q.items.map(O=>l.jsx(Sp,{m:O,selected:L.id===O.id,hover:w===O.id,onHover:_,onClick:()=>{o?.(O.id,O),k(!1)}},O.id))]},q.label))]})]})]})}function Sp({m:i,selected:c,hover:u,onHover:o,onClick:d}){return l.jsxs("button",{type:"button",role:"option","aria-selected":c,"data-selected":c||void 0,onMouseEnter:()=>o(i.id),onMouseLeave:()=>o(null),onClick:d,style:{display:"grid",gridTemplateColumns:"14px 1fr auto",columnGap:10,alignItems:"start",textAlign:"left",padding:"7px 8px",border:"none",borderRadius:4,cursor:"pointer",color:"var(--ink-0)",background:u?"var(--bg-hover)":"transparent",width:"100%"},children:[l.jsx("span",{style:{paddingTop:2},children:c&&l.jsx(ie,{name:"check",size:14,color:"var(--brand)"})}),l.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[l.jsxs("span",{style:{display:"flex",alignItems:"baseline",gap:8},children:[l.jsx("span",{style:{fontWeight:c?"var(--fw-semibold)":"inherit"},children:i.label}),l.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i.model})]}),i.note&&l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:i.note}),i.record&&l.jsx("span",{title:"From Foreman's own run records on this machine",style:{fontSize:"var(--fs-xs)",color:"var(--ink-1)",fontVariantNumeric:"tabular-nums"},children:i.record})]}),l.jsx("span",{style:{paddingTop:3},children:l.jsx(A1,{cost:i.cost})})]})}$t.useModels=D1;function xt({checked:i=!1,onChange:c,disabled:u,label:o,size:d="md",style:h}){const[m,y]=g.useState(!1),x=d==="sm"?28:34,p=d==="sm"?16:20,S=p-4;return l.jsx("button",{type:"button",role:"switch","aria-checked":i,"aria-label":o,disabled:u,onClick:()=>c?.(!i),onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),style:{position:"relative",width:x,height:p,flex:"0 0 auto",padding:0,borderRadius:"var(--r-pill)",border:`1px solid ${i?"var(--brand)":m?"var(--ink-2)":"var(--line-strong)"}`,background:i?"var(--brand)":"var(--bg-inset)",cursor:u?"default":"pointer",opacity:u?.5:1,transition:"background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease)",...h},children:l.jsx("span",{"aria-hidden":!0,style:{position:"absolute",top:1,left:i?x-S-3:1,width:S,height:S,borderRadius:"var(--r-pill)",background:i?"var(--brand-ink)":"var(--ink-1)",transition:"left var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease)"}})})}const O1=`Describe the mission…
|
|
37
|
+
|
|
38
|
+
Say what "done" looks like, name constraints, and flag any decision the director should ask you about before implementing.`,N1=[{id:"bugfix",label:"Bug fix",icon:"Bug",budget:3,director:"",worker:"sonnet",brief:`Fix: <describe the bug and how to reproduce it>
|
|
39
|
+
|
|
40
|
+
Done when: the reproduction no longer fails and a regression test covers it.
|
|
41
|
+
Constraints: no unrelated refactors; keep the public API unchanged.
|
|
42
|
+
Ask me before: changing behaviour that other code depends on.`},{id:"tests",label:"Add tests",icon:"ListChecks",budget:4,director:"",worker:"haiku",brief:`Add tests for: <module or feature>
|
|
43
|
+
|
|
44
|
+
Done when: each public function has at least one happy-path and one edge-case test, and the suite passes.
|
|
45
|
+
Constraints: use the existing test runner and conventions; no new dependencies.
|
|
46
|
+
Ask me before: changing production code to make it testable.`},{id:"refactor",label:"Refactor",icon:"Shuffle",budget:6,director:"fable",worker:"sonnet",brief:`Refactor: <what, and why>
|
|
47
|
+
|
|
48
|
+
Done when: behaviour is unchanged (existing tests pass), the code is <goal, e.g. split into pure functions>, and nothing outside <scope> is touched.
|
|
49
|
+
Constraints: one concern per commit-sized step; keep diffs reviewable.
|
|
50
|
+
Ask me before: renaming anything exported.`},{id:"audit",label:"Audit",icon:"SearchCheck",budget:2,director:"",worker:"haiku",brief:`Audit: <area, e.g. error handling / security / accessibility>
|
|
51
|
+
|
|
52
|
+
Done when: a written report in .foreman/AUDIT.md lists findings ranked by severity with file:line references — no code changes.
|
|
53
|
+
Constraints: read-only; do not modify source files.
|
|
54
|
+
Ask me before: nothing — this mission only reads.`}];function U1(i){if(!i)return"";let c=i.replace(/^\/(Users|home)\/[^/]+/,"~");const u=c.split("/");return u.length>4&&(c=[u[0],u[1],"…",...u.slice(-2)].join("/")),c}function qc(i){return`foreman:draft:${i||"default"}`}const Lc=i=>`${i.name}:${i.size}`;function kp({children:i}){return l.jsx("kbd",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:18,height:18,padding:"0 4px",boxSizing:"border-box",background:"var(--bg-inset)",border:"1px solid var(--line-strong)",borderRadius:4,color:"var(--ink-1)",fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",lineHeight:1},children:i})}function Yc({icon:i,label:c,active:u,onClick:o}){const[d,h]=g.useState(!1);return l.jsx("button",{type:"button",title:c,"aria-label":c,"aria-pressed":u,onClick:o,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:26,height:24,padding:0,background:u?"var(--bg-inset)":d?"var(--bg-hover)":"transparent",border:"none",borderRadius:4,color:u||d?"var(--ink-0)":"var(--ink-2)",cursor:"pointer"},children:l.jsx(ie,{name:i,size:14})})}function wp({icon:i,label:c,active:u,onClick:o}){return l.jsxs("button",{type:"button",onClick:o,"aria-selected":u,role:"tab",style:{display:"inline-flex",alignItems:"center",gap:5,padding:"0 10px",height:32,background:"none",border:"none",borderBottom:`2px solid ${u?"var(--brand)":"transparent"}`,marginBottom:-1,color:u?"var(--ink-0)":"var(--ink-2)",fontSize:"var(--fs-sm)",fontWeight:u?"var(--fw-semibold)":"inherit",cursor:"pointer"},children:[l.jsx(ie,{name:i,size:13}),c]})}function H1({folder:i,defaultBudgetUsd:c=5,error:u,errorAction:o,busy:d,templates:h=N1,models:m,modelsLoading:y,modelsNote:x,modelsInheritNote:p,onStart:S,style:b}){const k=g.useMemo(()=>{try{return JSON.parse(localStorage.getItem(qc(i))||"null")}catch{return null}},[i]),[w,_]=g.useState(k?.mission??""),[X,M]=g.useState(k?.budget??c),[z,R]=g.useState(k?.directorModel??""),[N,Z]=g.useState(k?.workerModel??""),[re,B]=g.useState(k?.directorProviderId),[L,P]=g.useState(k?.workerProviderId),[G,ce]=g.useState(k?.browserTools??!1),[te,ee]=g.useState(k?"restored":null),[xe,se]=g.useState("write"),[me,j]=g.useState([]),[q,O]=g.useState(!1),[ue,he]=g.useState(!1),T=g.useRef(null),Q=g.useRef(null);g.useEffect(()=>{const W=setTimeout(()=>{try{(w.trim()||k)&&(localStorage.setItem(qc(i),JSON.stringify({mission:w,budget:X,directorModel:z,workerModel:N,browserTools:G})),w.trim()&&ee("saved"))}catch{}},400);return()=>clearTimeout(W)},[w,X,z,N,G,i]);const A=W=>{_(W.brief),M(W.budget),R(W.director),Z(W.worker),se("write")},F=()=>{_(""),j([]),ee(null);try{localStorage.removeItem(qc(i))}catch{}},ne=W=>{const ze=Array.from(W||[]);ze.length&&j(ae=>{const Ke=new Set(ae.map(Lc));return[...ae,...ze.filter(Ae=>!Ke.has(Lc(Ae)))]})},oe=!d&&w.trim().length>0,je=()=>{oe&&S?.({mission:w.trim(),budget:X,directorModel:z,workerModel:N,directorProviderId:re,workerProviderId:L,browserTools:G,attachments:me})},Ue=W=>{const ze=T.current;if(!ze){se("write");return}const ae=ze.selectionStart??w.length,Ke=ze.selectionEnd??ae,Ae=w.slice(ae,Ke);let wt,zt;if(W==="code")wt=`\`${Ae||"code"}\``,zt=Ae?ae+wt.length:ae+1;else if(W==="quote")wt=(Ae||"quoted text").split(`
|
|
55
|
+
`).map(Wn=>`> ${Wn}`).join(`
|
|
56
|
+
`),zt=Ae?ae+wt.length:ae+2;else{const rn=ae>0&&w[ae-1]!==`
|
|
57
|
+
`?`
|
|
58
|
+
`:"";wt=`${rn}\`\`\`
|
|
59
|
+
${Ae||""}
|
|
60
|
+
\`\`\`
|
|
61
|
+
`,zt=ae+rn.length+4}const Hl=w.slice(0,ae)+wt+w.slice(Ke);_(Hl),se("write"),requestAnimationFrame(()=>{ze.focus();const rn=Ae?zt:zt+(W==="code"?4:W==="quote"?11:0);ze.setSelectionRange(zt,rn)})},ge=q?"var(--brand)":ue?"var(--ink-2)":"var(--line-strong)";return l.jsxs("div",{style:{maxWidth:"var(--composer-max)",margin:"var(--sp-5) auto",padding:"0 var(--sp-4)",display:"flex",flexDirection:"column",gap:"var(--sp-3)",...b},children:[l.jsxs("div",{style:{minWidth:0},children:[l.jsx("h2",{style:{margin:0,fontSize:"var(--fs-lg)"},children:"New mission"}),l.jsx("div",{title:i,style:{color:"var(--ink-2)",fontSize:"var(--fs-xs)",fontFamily:"var(--font-mono)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:U1(i)})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:"var(--fs-xs)",color:"var(--ink-2)",marginRight:2},children:[l.jsx(ie,{name:"template",size:12}),"Start from"]}),h.map(W=>l.jsx(le,{size:"sm",icon:W.icon,title:`Budget $${W.budget} · director ${W.director||"default"} · workers ${W.worker||"default"}`,onClick:()=>A(W),children:W.label},W.id))]}),l.jsxs("div",{onDragOver:W=>{W.preventDefault(),q||O(!0)},onDragLeave:W=>{W.currentTarget.contains(W.relatedTarget)||O(!1)},onDrop:W=>{W.preventDefault(),O(!1),ne(W.dataTransfer.files)},style:{background:"var(--bg-card)",border:`1px solid ${ge}`,borderRadius:"var(--r-md)",overflow:"hidden",boxShadow:q?"0 0 0 3px var(--brand-wash-strong)":"none",transition:"border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease)"},children:[l.jsxs("div",{role:"tablist",style:{display:"flex",alignItems:"center",gap:2,padding:"0 6px",borderBottom:"1px solid var(--line)",background:"var(--bg-panel)"},children:[l.jsx(wp,{icon:"write",label:"Write",active:xe==="write",onClick:()=>se("write")}),l.jsx(wp,{icon:"preview",label:"Preview",active:xe==="preview",onClick:()=>se("preview")}),l.jsx("span",{style:{flex:1}}),l.jsx(Yc,{icon:"quote",label:"Quote (> )",onClick:()=>Ue("quote")}),l.jsx(Yc,{icon:"code",label:"Inline code (`)",onClick:()=>Ue("code")}),l.jsx(Yc,{icon:"codeBlock",label:"Code block (```)",onClick:()=>Ue("block")})]}),xe==="write"?l.jsx(E1,{ref:T,value:w,onChange:_,placeholder:O1,minHeight:200,maxHeight:440,onKeyDown:W=>{(W.metaKey||W.ctrlKey)&&W.key==="Enter"&&(W.preventDefault(),je())},onPaste:W=>{W.clipboardData?.files?.length&&(W.preventDefault(),ne(W.clipboardData.files))},onFocus:()=>he(!0),onBlur:()=>he(!1)}):l.jsx("div",{style:{minHeight:200,maxHeight:440,overflowY:"auto",padding:"var(--sp-3)",boxSizing:"border-box"},children:w.trim()?l.jsx($i,{text:w}):l.jsx("span",{style:{color:"var(--ink-2)"},children:"Nothing to preview yet."})}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",padding:"6px 8px",borderTop:"1px solid var(--line)",minHeight:36,boxSizing:"border-box"},children:[l.jsx("input",{ref:Q,type:"file",multiple:!0,style:{display:"none"},onChange:W=>{ne(W.target.files),W.target.value=""}}),l.jsx(le,{size:"sm",variant:"ghost",icon:"attach",title:"Attach files — or drop them on the editor, or paste an image",onClick:()=>Q.current?.click(),children:"Attach"}),me.map((W,ze)=>l.jsx(Ip,{name:W.name,size:W.size,onRemove:()=>j(ae=>ae.filter((Ke,Ae)=>Ae!==ze))},Lc(W))),l.jsx("span",{style:{flex:1}}),l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8,fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:[te&&l.jsxs(l.Fragment,{children:[l.jsx(ie,{name:"draft",size:11}),te==="restored"?"Draft restored":"Draft saved"]}),(w||me.length>0)&&l.jsx("button",{type:"button",onClick:F,style:{background:"none",border:"none",padding:0,color:"var(--ink-2)",cursor:"pointer",font:"inherit",textDecoration:"underline"},children:"Clear"})]})]})]}),l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"var(--sp-4)",flexWrap:"wrap"},children:[l.jsx(vt,{layout:"stacked",label:"Budget cap",hint:"Hard stop; the run halts here.",children:l.jsx(Be,{type:"number",min:1,step:1,width:96,prefix:"$",value:X,onChange:M})}),l.jsx(vt,{layout:"stacked",label:"Director",hint:"Plans, delegates, verifies.",children:l.jsx($t,{value:z,models:m,loading:y,note:x,inheritNote:p,onChange:(W,ze)=>{R(W),B(ze?.providerId)}})}),l.jsx(vt,{layout:"stacked",label:"Workers",hint:"Implement. Cheaper models cut cost.",children:l.jsx($t,{value:N,models:m,loading:y,note:x,inheritNote:p,onChange:(W,ze)=>{Z(W),P(ze?.providerId)}})}),l.jsx(vt,{label:"Browser",hint:"Headless Playwright for the agents — navigate, click, screenshot. Non-local URLs still ask you.",children:l.jsx(xt,{checked:G,onChange:ce,label:G?"on":"off"})})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"var(--sp-3)",flexWrap:"wrap"},children:[u&&l.jsxs(Fe,{tone:"error",inline:!0,style:{marginRight:"auto"},children:[u,o&&l.jsx("button",{type:"button",onClick:o.onClick,disabled:d,style:{marginLeft:8,background:"none",border:0,padding:0,font:"inherit",color:"inherit",textDecoration:"underline",cursor:d?"default":"pointer"},children:o.label})]}),l.jsxs("span",{title:"Start the mission with Cmd+Enter from the editor",style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:[l.jsx(kp,{children:"⌘"}),l.jsx(kp,{children:"↵"})]}),l.jsx(le,{variant:"primary",disabled:!oe,onClick:je,children:"Start mission"})]})]})}function B1({questions:i=[],askedAt:c,who:u,onAnswer:o,onFreeText:d,style:h}){const[m,y]=g.useState({}),[x,p]=g.useState(""),[S,b]=g.useState(0),[k,w]=g.useState(!1),_=g.useRef(null),X=i.length===1&&!i[0]?.multi,M=i.every(L=>{const P=m[L.question];return Array.isArray(P)?P.length>0:!!P});g.useEffect(()=>{y({}),p(""),b(0),w(!1)},[i]);const z=g.useMemo(()=>{const L={};for(const P of i){const G=m[P.question];Array.isArray(G)?L[P.question]=G.join(", "):G&&(L[P.question]=G)}return L},[m,i]),R=L=>{k||(w(!0),o?.(L))},N=(L,P)=>{if(k)return;if(L.multi){y(ce=>{const te=Array.isArray(ce[L.question])?ce[L.question]:[],ee=te.includes(P)?te.filter(xe=>xe!==P):[...te,P];return{...ce,[L.question]:ee}});return}const G={...m,[L.question]:P};y(G),X&&R({[L.question]:P})},Z=()=>{const L=x.trim();if(!L||k)return;const P=i[Math.min(S,i.length-1)],G={...z,[P.question]:L};if(i.length===1){w(!0),o?.(G);return}w(!0),o?.(G)},re=L=>{if(L.target.tagName==="TEXTAREA"){(L.metaKey||L.ctrlKey)&&L.key==="Enter"&&(L.preventDefault(),Z());return}const P=i[S];if(P)if(/^[1-9]$/.test(L.key)){const G=P.options[Number(L.key)-1];G&&(L.preventDefault(),N(P,G.label))}else L.key==="ArrowDown"?(L.preventDefault(),b(G=>Math.min(i.length-1,G+1))):L.key==="ArrowUp"?(L.preventDefault(),b(G=>Math.max(0,G-1))):L.key==="Enter"&&!X&&M&&(L.preventDefault(),R(z))},B=c?Math.max(0,Math.round((Date.now()-c)/6e4)):0;return l.jsxs("div",{ref:_,tabIndex:0,onKeyDown:re,style:{flex:"0 0 auto",outline:"none",background:"var(--bg-card)",border:"1px solid var(--brand)",borderRadius:"var(--r-md)",overflow:"hidden",opacity:k?.6:1,transition:"opacity var(--dur-fast) var(--ease)",...h},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"var(--sp-2) var(--sp-3)",borderBottom:"1px solid var(--line)",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:[l.jsx(ie,{name:"question",size:14,color:"var(--brand)"}),l.jsx("span",{style:{color:"var(--ink-1)",fontWeight:"var(--fw-semibold)"},children:"The foreman asks"}),l.jsx("span",{children:"· pick an answer, or type one"}),B>=1&&l.jsxs("span",{style:{marginLeft:"auto"},children:["waiting ",B,"m"]})]}),i.map((L,P)=>{const G=m[L.question],ce=Array.isArray(G)?G.length>0:!!G,te=P===S;return l.jsxs("div",{onMouseEnter:()=>b(P),style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"1px solid var(--line)",background:te&&i.length>1?"var(--bg-inset)":"transparent"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:6,marginBottom:6,fontSize:"var(--fs-md)",color:"var(--ink-0)"},children:[i.length>1&&l.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",color:ce?"var(--status-ok, var(--brand))":"var(--ink-2)"},children:ce?"✓":`${P+1}.`}),l.jsx("span",{children:L.question}),L.multi&&l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:"choose any"})]}),l.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:L.options.map((ee,xe)=>{const se=Array.isArray(G)?G.includes(ee.label):G===ee.label;return l.jsxs("button",{type:"button",disabled:k,onClick:()=>N(L,ee.label),title:ee.hint||(xe===0?"Recommended":void 0),style:{display:"inline-flex",flexDirection:"column",alignItems:"flex-start",gap:2,padding:"6px 10px",borderRadius:"var(--r-sm)",cursor:k?"default":"pointer",font:"inherit",textAlign:"left",maxWidth:360,background:se?"color-mix(in srgb, var(--brand) 16%, transparent)":"var(--bg-inset)",border:`1px solid ${se?"var(--brand)":"var(--line-strong)"}`,color:se?"var(--brand)":"var(--ink-0)",transition:"border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease)"},children:[l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:"var(--fs-sm)"},children:[l.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",minWidth:14,color:se?"var(--brand)":"var(--ink-2)"},children:xe+1}),ee.label,xe===0&&l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontWeight:"var(--fw-normal)"},children:"· recommended"})]}),ee.hint&&l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",lineHeight:"var(--lh)"},children:ee.hint})]},ee.label)})})]},L.question)}),l.jsxs("div",{style:{display:"flex",alignItems:"flex-end",gap:"var(--sp-2)",padding:"var(--sp-2) var(--sp-3)"},children:[l.jsx("textarea",{rows:1,value:x,disabled:k,placeholder:i.length>1?`Something else for question ${S+1}…`:"Something else…",onChange:L=>p(L.target.value),onFocus:()=>{},style:{flex:1,minWidth:0,resize:"none",border:"none",outline:"none",background:"transparent",color:"var(--ink-0)",font:"inherit",lineHeight:"var(--lh)",padding:"4px 0"}}),x.trim()?l.jsx(le,{size:"sm",icon:"send",onClick:Z,disabled:k,title:"⌘↵",children:"Send"}):X?null:l.jsx(le,{size:"sm",variant:"primary",onClick:()=>R(z),disabled:k||!M,title:M?"Enter":"Answer every question first",children:"Send answers"})]}),u&&l.jsxs("div",{style:{padding:"0 var(--sp-3) var(--sp-2)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontFamily:"var(--font-mono)"},children:[u.model," · ",String(u.provider).split(" · ")[0]]})]})}function $1({mission:i,doneWhen:c=[],budgetUsd:u=5,rationale:o,browser:d=!1,directorModel:h="",workerModel:m="",directorProviderId:y,workerProviderId:x,modelRationale:p,models:S,modelsLoading:b,modelsNote:k,modelsInheritNote:w,busy:_,error:X,errorAction:M,onStart:z,onDismiss:R,style:N}){const[Z,re]=g.useState(i),[B,L]=g.useState(u),[P,G]=g.useState(!!d),[ce,te]=g.useState(h||""),[ee,xe]=g.useState(m||""),[se,me]=g.useState(y),[j,q]=g.useState(x),O=Z!==i||Number(B)!==Number(u);return l.jsxs("section",{style:{background:"var(--bg-card)",border:"1px solid var(--brand)",borderRadius:"var(--r-md)",padding:"var(--sp-4)",display:"flex",flexDirection:"column",gap:"var(--sp-3)",...N},children:[l.jsxs("header",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[l.jsx(ie,{name:"orchestration",size:16,color:"var(--brand)"}),l.jsx("span",{style:{fontSize:"var(--fs-lg)",fontWeight:"var(--fw-semibold)"},children:"Proposed mission"}),O&&l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:"edited"})]}),o&&l.jsx("p",{style:{margin:0,fontSize:"var(--fs-sm)",color:"var(--ink-1)"},children:o}),l.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:6},children:[l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",textTransform:"uppercase",letterSpacing:"var(--ls-caps)"},children:"Brief"}),l.jsx("textarea",{value:Z,onChange:ue=>re(ue.target.value),rows:6,style:{resize:"vertical",minHeight:"6rem",background:"var(--bg-inset)",border:"1px solid var(--line)",borderRadius:"var(--r-sm)",padding:"var(--sp-2) var(--sp-3)",color:"var(--ink-0)",font:"inherit",lineHeight:"var(--lh-prose)",outline:"none"}})]}),c.length>0&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",textTransform:"uppercase",letterSpacing:"var(--ls-caps)"},children:"Done when"}),c.map((ue,he)=>l.jsxs("div",{style:{display:"flex",gap:8,alignItems:"flex-start",fontSize:"var(--fs-sm)",color:"var(--ink-1)"},children:[l.jsx("span",{style:{color:"var(--ink-2)",fontFamily:"var(--font-mono)",flex:"0 0 auto"},children:"▢"}),l.jsx("span",{children:ue})]},he))]}),p&&(h||m)&&l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:6,fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:[l.jsx(ie,{name:"model",size:12}),l.jsxs("span",{children:[l.jsx("span",{style:{color:"var(--ink-1)"},children:"Suggested models —"})," ",p]})]}),l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"var(--sp-4)",flexWrap:"wrap"},children:[l.jsx(vt,{layout:"stacked",label:"Budget cap",hint:"Hard stop; the run halts here.",children:l.jsx(Be,{type:"number",prefix:"$",min:0,step:1,width:96,value:B,onChange:L})}),l.jsx(vt,{layout:"stacked",label:"Director",hint:"Plans, delegates, verifies.",children:l.jsx($t,{value:ce,models:S,loading:b,note:k,inheritNote:w,onChange:(ue,he)=>{te(ue),me(he?.providerId)}})}),l.jsx(vt,{layout:"stacked",label:"Workers",hint:"Implement. Cheaper models cut cost.",children:l.jsx($t,{value:ee,models:S,loading:b,note:k,inheritNote:w,onChange:(ue,he)=>{xe(ue),q(he?.providerId)}})}),l.jsx(vt,{label:"Browser",hint:d?"The planner judged the criteria need a browser, so it starts on.":"Headless Playwright for the agents — navigate, click, screenshot. Non-local URLs still ask you.",children:l.jsx(xt,{checked:P,onChange:G,label:P?"on":"off"})})]}),X&&l.jsxs(Fe,{tone:"error",inline:!0,children:[X,M&&l.jsx("button",{type:"button",onClick:M.onClick,disabled:_,style:{marginLeft:8,background:"none",border:0,padding:0,font:"inherit",color:"inherit",textDecoration:"underline",cursor:_?"default":"pointer"},children:M.label})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"var(--sp-2)"},children:[l.jsx(le,{variant:"ghost",onClick:R,disabled:_,children:"Not this one"}),l.jsx(le,{variant:"primary",icon:"orchestration",disabled:_||!Z.trim(),title:"Starts the mission: a director plans it and workers do the work",onClick:()=>z?.({mission:Z.trim(),budget:Number(B)||u,directorModel:ce,workerModel:ee,directorProviderId:se,workerProviderId:j,browserTools:P}),children:_?"Starting…":"Start mission"})]})]})}const q1=[{value:"next",label:"Next turn",icon:"nextTurn"},{value:"now",label:"Now",icon:"now"}];function L1({agents:i=[],to:c,onTo:u,value:o,onChange:d,timing:h,onTiming:m,onSend:y,disabled:x,disabledReason:p,style:S}){const[b,k]=g.useState(""),[w,_]=g.useState("director"),[X,M]=g.useState("next"),[z,R]=g.useState(!1),[N,Z]=g.useState(!1),re=g.useRef(null),B=g.useRef(null),L=o??b,P=d??k,G=c??w,ce=u??_,te=h??X,ee=m??M,xe=i.filter(j=>j.status==="running"||j.id==="director"),se=!x&&L.trim().length>0;g.useEffect(()=>{const j=re.current;j&&(j.style.height="auto",j.style.height=Math.min(j.scrollHeight,132)+"px")},[L]),g.useEffect(()=>{if(!z)return;const j=q=>{B.current&&!B.current.contains(q.target)&&R(!1)};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[z]);const me=()=>{se&&(y?.(L.trim(),{to:G,timing:te}),P(""))};return l.jsxs("div",{ref:B,style:{position:"relative",flex:"0 0 auto",background:"var(--bg-card)",border:`1px solid ${N?"var(--brand)":"var(--line-strong)"}`,borderRadius:"var(--r-md)",padding:"var(--sp-2) var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-2)",opacity:x?.6:1,transition:"border-color var(--dur-fast) var(--ease)",...S},children:[l.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",alignItems:"flex-start"},children:[l.jsx(ie,{name:"steer",size:15,color:"var(--brand)",style:{marginTop:3,flex:"0 0 auto"}}),l.jsx("textarea",{ref:re,rows:1,value:L,disabled:x,placeholder:x?p||"Nothing is running.":`Steer ${G}… a constraint, a correction, a hint. Not a question reply.`,onChange:j=>P(j.target.value),onFocus:()=>Z(!0),onBlur:()=>Z(!1),onKeyDown:j=>{(j.metaKey||j.ctrlKey)&&j.key==="Enter"&&(j.preventDefault(),me())},style:{flex:1,minWidth:0,resize:"none",border:"none",outline:"none",background:"transparent",color:"var(--ink-0)",font:"inherit",lineHeight:"var(--lh)",padding:"2px 0",maxHeight:132}})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",flexWrap:"wrap"},children:[l.jsx(Y1,{agent:G,open:z,onClick:()=>!x&&R(j=>!j),disabled:x}),l.jsx(sn,{size:"sm",tabs:q1,value:te,onChange:ee}),l.jsx("span",{style:{marginLeft:"auto",fontSize:"var(--fs-xs)",color:"var(--ink-2)",whiteSpace:"nowrap"},children:te==="now"?"Interrupts the current tool call":"Delivered before the next tool call"}),l.jsx(le,{size:"sm",icon:"send",onClick:me,disabled:!se,title:"⌘↵",children:"Send"})]}),z&&l.jsx("div",{role:"listbox",style:{position:"absolute",left:"var(--sp-3)",bottom:"calc(100% - 4px)",zIndex:10,minWidth:220,background:"var(--bg-panel)",border:"1px solid var(--line-strong)",borderRadius:"var(--r-sm)",boxShadow:"var(--shadow-pop, 0 8px 24px rgba(0,0,0,.35))",padding:4},children:xe.map(j=>l.jsx(G1,{agent:j,selected:j.id===G,onSelect:()=>{ce(j.id),R(!1),re.current?.focus()}},j.id))})]})}function Y1({agent:i,open:c,onClick:u,disabled:o}){const[d,h]=g.useState(!1);return l.jsxs("button",{type:"button",onClick:u,disabled:o,"aria-haspopup":"listbox","aria-expanded":c,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"3px 8px 3px 6px",borderRadius:"var(--r-pill)",border:"1px solid var(--line)",cursor:o?"default":"pointer",background:c||d?"var(--bg-hover)":"var(--bg-inset)",color:"var(--ink-0)",font:"inherit",fontSize:"var(--fs-xs)"},children:[l.jsx("span",{style:{color:"var(--ink-2)"},children:"to"}),l.jsx(mn,{agent:i,size:"sm"}),l.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:i}),l.jsx(ie,{name:"chevronDown",size:12,color:"var(--ink-2)"})]})}function G1({agent:i,selected:c,onSelect:u}){const[o,d]=g.useState(!1);return l.jsxs("button",{type:"button",role:"option","aria-selected":c,onClick:u,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),style:{display:"flex",alignItems:"center",gap:8,width:"100%",textAlign:"left",padding:"6px 8px",borderRadius:4,border:"none",cursor:"pointer",font:"inherit",background:o?"var(--bg-hover)":"transparent",color:"var(--ink-0)"},children:[l.jsx("span",{style:{width:12,display:"inline-flex",color:"var(--brand)"},children:c&&l.jsx(ie,{name:"check",size:12,strokeWidth:2.5})}),l.jsx(mn,{agent:i.id,size:"sm"}),l.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-sm)"},children:i.id}),i.task&&l.jsx("span",{style:{marginLeft:"auto",fontSize:"var(--fs-xs)",color:"var(--ink-2)",maxWidth:140,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i.task})]})}function W1({agents:i=[],filter:c,onFilter:u,style:o}){return l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",...o},children:[l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:"var(--fs-xs)",color:"var(--ink-2)",marginRight:2},children:[l.jsx(ie,{name:"crew",size:12}),"Crew"]}),i.map(d=>{const h=c===d.id;return l.jsxs("button",{type:"button",onClick:()=>u?.(d.id),title:d.task||d.id,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"2px 8px 2px 6px",borderRadius:"var(--r-pill)",background:h?"var(--bg-card)":"var(--bg-inset)",border:`1px solid ${h?"var(--line-strong)":"var(--line)"}`,color:h?"var(--ink-0)":"var(--ink-1)",fontSize:"var(--fs-xs)",cursor:"pointer",font:"inherit",lineHeight:"16px"},children:[l.jsx(mn,{agent:d.id,size:"sm"}),d.id,l.jsx(ie,{name:d.status||"running",size:11,strokeWidth:2.25,color:d.status==="error"?"var(--status-critical)":d.status==="interrupted"?"var(--status-serious)":d.status==="idle"?"var(--ink-2)":"var(--status-good)"})]},d.id)})]})}function X1({mission:i,title:c,createdAt:u,costUsd:o=0,costBasis:d="priced",usage:h,status:m="done",selected:y,current:x,onSelect:p,style:S}){const[b,k]=g.useState(!1),w=Number(o)||0,_=h?(h.inputTokens||0)+(h.outputTokens||0)+(h.cacheReadTokens||0)+(h.cacheWriteTokens||0):0,X=d==="priced"?`$${w.toFixed(2)}`:d==="unpriced"&&_>0?`${Ga(_)} tok`:null,M=u?new Date(u).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):null;return l.jsxs("div",{role:"button",title:i,onClick:p,onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),style:{padding:"6px 10px",borderRadius:"var(--r-sm)",cursor:p?"pointer":"default",background:y?"var(--bg-card)":b&&p?"var(--bg-hover)":"transparent",border:y?"1px solid var(--line-strong)":"1px solid transparent",marginBottom:2,transition:"background var(--dur-fast) var(--ease)",...S},children:[l.jsx("div",{style:{fontSize:"var(--fs-sm)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",color:"var(--ink-0)",fontWeight:x?"var(--fw-semibold)":"var(--fw-regular)"},children:c||i}),l.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",alignItems:"center",marginTop:2,fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontVariantNumeric:"tabular-nums"},children:[M&&l.jsx("span",{children:M}),X&&l.jsx("span",{title:d==="unpriced"?"This provider publishes no prices; tokens are what is known.":void 0,children:X}),l.jsx(ya,{status:m})]})]})}function V1({agent:i,title:c,toolName:u,decisionReason:o,input:d,escapedPath:h,onAllow:m,onAlways:y,onDeny:x,style:p}){const S=u||(c||"").replace(/^Wants to use\s+/i,"")||"tool",b=h?{label:"Allow this path (run)",hint:`Allow ${h} for the rest of the run; other paths outside the folder will still ask`}:{label:"Always (run)",hint:"Allow this tool for the rest of the run"};return l.jsxs(iu,{accent:"var(--brand)",style:{marginBottom:"var(--sp-2)",...p},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontWeight:"var(--fw-semibold)",color:"var(--brand)",fontSize:"var(--fs-sm)"},children:[l.jsx(ie,{name:"approval",size:14,strokeWidth:2}),l.jsxs("span",{children:[i," wants to use ",S]})]}),o&&l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5,color:"var(--status-serious)",fontSize:"var(--fs-xs)",marginTop:4},children:[l.jsx(ie,{name:"caution",size:12,strokeWidth:2}),o]}),l.jsx(tv,{tool:S,input:typeof d=="string"?void 0:d,body:typeof d=="string"?d:void 0,defaultOpen:!0,style:{margin:"var(--sp-2) 0"}}),l.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",flexWrap:"wrap",justifyContent:"flex-end"},children:[l.jsx(le,{variant:"good",onClick:m,children:"Allow"}),l.jsx(le,{variant:"good",onClick:y,title:b.hint,children:b.label}),l.jsx(le,{variant:"danger",onClick:x,children:"Deny"})]})]})}function Q1({question:i,options:c=[],value:u,onChange:o,onAnswer:d,style:h}){const[m,y]=g.useState(""),x=u??m,p=o??y;return l.jsxs(iu,{accent:"var(--brand)",style:{marginBottom:"var(--sp-2)",...h},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontWeight:"var(--fw-semibold)",color:"var(--brand)",fontSize:"var(--fs-sm)",marginBottom:4},children:[l.jsx(ie,{name:"question",size:14,strokeWidth:2}),"Director asks:"]}),l.jsx("div",{style:{whiteSpace:"pre-wrap",fontSize:"var(--fs-md)"},children:i}),c.length>0&&l.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,margin:"var(--sp-2) 0 0"},children:c.map((S,b)=>l.jsxs("button",{type:"button",onClick:()=>d?.(S),title:b===0?"Recommended":void 0,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"6px 10px",borderRadius:"var(--r-sm)",cursor:"pointer",font:"inherit",fontSize:"var(--fs-sm)",background:"var(--bg-inset)",border:"1px solid var(--line-strong)",color:"var(--ink-0)"},children:[l.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:b+1}),S,b===0&&l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:"· recommended"})]},S))}),l.jsx("div",{style:{margin:"var(--sp-2) 0"},children:l.jsx(ru,{size:"answer",value:x,onChange:p})}),l.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:l.jsx(le,{variant:"primary",onClick:()=>d?.(x),disabled:!String(x).trim(),children:"Answer"})})]})}function K1(i,c){if(!i)return"";const u=Math.max(0,Math.round((c-i)/1e3));return u<60?`${u}s`:u<3600?`${Math.floor(u/60)}m`:`${Math.floor(u/3600)}h ${Math.floor(u%3600/60)}m`}function zp({since:i,now:c}){const u=K1(i,c);return u?l.jsxs("div",{style:{fontSize:"var(--fs-xs)",color:"var(--status-warning)",fontWeight:"var(--fw-semibold)",marginBottom:4},children:["waiting ",u]}):null}function Z1({approvals:i=[],questions:c=[],now:u=Date.now(),running:o=!1,activity:d,onAllow:h,onAlways:m,onDeny:y,onAnswer:x,style:p}){const S=i.length+c.length;if(S===0&&!o||S===0&&!d)return null;const b={flex:"0 0 auto",padding:"var(--sp-2) var(--sp-3)",borderBottom:"1px solid var(--line)",...p};return S===0?l.jsxs("div",{role:"status",style:{...b,display:"flex",alignItems:"center",gap:"var(--sp-2)",background:"var(--bg-panel)",fontSize:"var(--fs-sm)",minWidth:0},children:[l.jsx(ie,{name:"running",size:14,color:"var(--status-good)",strokeWidth:2}),d.agent&&l.jsx(mn,{agent:d.agent,size:"sm"}),l.jsx("span",{style:{color:"var(--ink-0)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},title:d.line,children:d.line}),d.crew&&l.jsx("span",{style:{marginLeft:"auto",flex:"0 0 auto",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:d.crew})]}):l.jsxs("div",{role:"region","aria-label":"Needs you",style:{...b,background:"var(--brand-wash-strong)",borderTop:"2px solid var(--status-warning)",display:"flex",flexDirection:"column",gap:"var(--sp-2)",maxHeight:"55vh",overflowY:"auto"},children:[l.jsxs("div",{className:"pulse",style:{display:"flex",alignItems:"center",gap:6,fontSize:"var(--fs-xs)",color:"var(--status-warning)",fontWeight:"var(--fw-semibold)",textTransform:"uppercase",letterSpacing:"var(--ls-caps)"},children:[l.jsx(ie,{name:"needsYou",size:13,strokeWidth:2.25}),"Needs you — ",[i.length?`${i.length} approval${i.length===1?"":"s"}`:null,c.length?`${c.length} question${c.length===1?"":"s"}`:null].filter(Boolean).join(", ")]}),i.map(k=>l.jsxs("div",{children:[l.jsx(zp,{since:k.since,now:u}),l.jsx(V1,{agent:k.agent,title:k.title,toolName:k.toolName,decisionReason:k.decisionReason,input:k.input,escapedPath:k.escapedPath,onAllow:()=>h?.(k.id),onAlways:()=>m?.(k.id),onDeny:()=>y?.(k.id)})]},k.id)),c.map(k=>l.jsxs("div",{children:[l.jsx(zp,{since:k.since,now:u}),l.jsx(Q1,{question:k.question,options:k.options,onAnswer:w=>x?.(k.id,w)})]},k.id))]})}function cv(i){if(!i)return null;const c=String(i).split(`
|
|
62
|
+
`),u=c.findIndex(d=>/^#{1,6}\s*DONE\s*WHEN/i.test(d.trim()));if(u===-1)return null;const o=[];for(const d of c.slice(u+1)){if(/^#{1,6}\s/.test(d))break;const h=d.match(/^\s*[-*]\s*\[( |x|X)\]\s*(.*)$/);if(!h)continue;const m=h[2].trim().replace(/\*\*(.+?)\*\*/g,"$1").replace(/`([^`]*)`/g,"$1");o.push({text:m,done:h[1]!==" "})}return o.length?o:null}function F1(i){return i?`Done when · ${i.filter(c=>c.done).length} / ${i.length}`:"Done when"}function J1({doc:i,style:c}){const u=cv(i),o=u?u.filter(d=>d.done).length:0;return l.jsxs("section",{style:c,children:[l.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--sp-2)",marginBottom:"var(--sp-2)",fontSize:"var(--fs-xs)",fontWeight:"var(--fw-semibold)",textTransform:"uppercase",letterSpacing:"var(--ls-caps)",color:"var(--ink-2)"},children:[l.jsx("span",{children:"Done when"}),u&&l.jsxs("span",{style:{fontVariantNumeric:"tabular-nums",textTransform:"none",letterSpacing:0,color:o===u.length?"var(--status-good)":"var(--ink-1)"},children:[o," / ",u.length]})]}),!i&&l.jsx(Qe,{children:"MISSION.md not written yet."}),i&&!u&&l.jsx(Qe,{children:"No DONE WHEN section in the mission doc."}),u&&u.map((d,h)=>l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"var(--sp-2)",padding:"3px 0",fontSize:"var(--fs-sm)",lineHeight:"var(--lh)",color:d.done?"var(--ink-2)":"var(--ink-0)"},children:[l.jsx(ie,{name:d.done?"done":"idle",size:14,strokeWidth:2,color:d.done?"var(--status-good)":"var(--ink-2)",style:{marginTop:2}}),l.jsx("span",{style:{textDecoration:d.done?"line-through":"none"},children:d.text})]},h))]})}function I1({text:i,truncated:c,style:u}){const o=String(i||"").split(`
|
|
63
|
+
`);return l.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",lineHeight:"var(--lh)",background:"var(--bg-inset)",overflowX:"auto",...u},children:[o.map((d,h)=>{const m=d.startsWith("@@")||d.startsWith("diff ")||d.startsWith("index ")||d.startsWith("--- ")||d.startsWith("+++ "),y=!m&&d.startsWith("+"),x=!m&&d.startsWith("-");return l.jsx("div",{style:{padding:"0 var(--sp-2)",whiteSpace:"pre",background:y?"var(--diff-add-bg)":x?"var(--diff-del-bg)":"transparent",color:m?"var(--ink-2)":"var(--ink-0)"},children:d||" "},h)}),c&&l.jsx("div",{style:{padding:"2px var(--sp-2)",color:"var(--ink-2)",fontFamily:"var(--font-ui)"},children:"first 400 lines — the rest is in your working tree"})]})}const Gc=512*1024;function Pc({artifact:i,url:c,previewUrl:u,onClose:o,index:d,count:h,onStep:m}){const y=/\.html?$/i.test(i?.path??""),[x,p]=g.useState("rendered"),S=typeof m=="function"&&typeof h=="number"&&h>1,b=S&&d>0?()=>m(d-1):null,k=S&&d<h-1?()=>m(d+1):null,[w,_]=g.useState(null),[X,M]=g.useState(null),z=i?.kind,R=z==="diff",N=i?.path?.split("/").pop()??"",Z=/\.md$/i.test(N);if(g.useEffect(()=>{const P=G=>{G.key==="Escape"?o():G.key==="ArrowLeft"&&b?(G.preventDefault(),b()):G.key==="ArrowRight"&&k&&(G.preventDefault(),k())};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[o,b,k]),g.useEffect(()=>{if(_(null),M(null),z!=="text"||!c)return;let P=!0;return fetch(c).then(async G=>{if(!G.ok)throw new Error(`HTTP ${G.status}`);const ce=await G.text();P&&_(ce.length>Gc?`${ce.slice(0,Gc)}
|
|
64
|
+
|
|
65
|
+
[… ${ce.length-Gc} more characters — open in a new tab for the whole file]`:ce)}).catch(G=>{P&&M(String(G.message||G))}),()=>{P=!1}},[c,z]),!i)return null;const re=typeof i.size!="number"?null:i.size>=1024*1024?`${(i.size/1024/1024).toFixed(1)} MB`:i.size>=1024?`${(i.size/1024).toFixed(1)} KB`:`${i.size} B`;let B;return R&&i.binary&&c&&/\.(png|jpe?g|webp|gif|svg)$/i.test(N)?B=l.jsx("img",{src:c,alt:i.path,style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain",display:"block",margin:"auto",background:"var(--bg-inset)"}}):R?B=i.binary?l.jsx("div",{style:{margin:"auto",color:"var(--ink-2)"},children:"Binary file — no diff to show."}):i.diff?l.jsx(I1,{text:i.diff,truncated:i.truncated,style:{minHeight:"100%"}}):l.jsx("div",{style:{margin:"auto",color:"var(--ink-2)"},children:"No diff recorded for this file."}):y&&u&&x==="rendered"?B=l.jsx("iframe",{title:i.path,src:u,sandbox:"allow-scripts",style:{width:"100%",height:"100%",border:"none",background:"#fff"}}):z==="image"?B=l.jsx("img",{src:c,alt:i.path,style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain",display:"block",margin:"auto",background:"var(--bg-inset)"}}):z==="pdf"?B=l.jsx("iframe",{title:i.path,src:c,style:{width:"100%",height:"100%",border:"none",background:"var(--bg-inset)"}}):z==="text"?B=X?l.jsxs("div",{style:{padding:"var(--sp-3)",color:"var(--status-critical)"},children:["Could not load it: ",X]}):w===null?l.jsx("div",{style:{padding:"var(--sp-3)",color:"var(--ink-2)"},children:"Loading…"}):Z?l.jsx("div",{style:{padding:"var(--sp-3) var(--sp-4)",maxWidth:"72ch",margin:"0 auto"},children:l.jsx($i,{text:w,slots:!1})}):l.jsx("pre",{style:{margin:0,padding:"var(--sp-3) var(--sp-4)",fontFamily:"var(--font-mono)",fontSize:"var(--fs-sm)",lineHeight:1.5,whiteSpace:"pre-wrap",wordBreak:"break-word",color:"var(--ink-0)",tabSize:2},children:w}):B=l.jsxs("div",{style:{margin:"auto",textAlign:"center",color:"var(--ink-2)",display:"flex",flexDirection:"column",gap:"var(--sp-2)",alignItems:"center"},children:[l.jsx(ie,{name:"file",size:28,color:"var(--ink-3)"}),l.jsx("span",{children:"No preview for this kind of file."}),l.jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--brand)"},children:["Download ",N]})]}),l.jsx("div",{role:"dialog","aria-modal":"true","aria-label":i.path,onClick:o,style:{position:"fixed",inset:0,zIndex:1e3,background:"rgba(0,0,0,0.55)",display:"flex",alignItems:"center",justifyContent:"center",padding:"var(--sp-4)"},children:l.jsxs("div",{onClick:P=>P.stopPropagation(),style:{width:"min(1200px, 100%)",height:"min(900px, 100%)",display:"flex",flexDirection:"column",background:"var(--bg-card)",border:"1px solid var(--line-strong)",borderRadius:"var(--r-md)",boxShadow:"0 24px 64px rgba(0,0,0,0.35)",overflow:"hidden"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"6px var(--sp-2) 6px var(--sp-3)",borderBottom:"1px solid var(--line)",background:"var(--bg-panel)",flex:"0 0 auto",minWidth:0},children:[l.jsx(ie,{name:z==="image"?"Image":z==="text"?"transcript":"file",size:14,color:"var(--ink-2)"}),R&&i.status&&l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",flex:"0 0 auto"},children:i.status}),l.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-sm)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,flex:1},title:i.path,children:i.path}),R?l.jsxs("span",{style:{fontSize:"var(--fs-xs)",fontFamily:"var(--font-mono)",fontVariantNumeric:"tabular-nums",flex:"0 0 auto"},children:[l.jsxs("span",{style:{color:"var(--status-good)"},children:["+",i.additions??0]})," ",l.jsxs("span",{style:{color:"var(--status-critical)"},children:["−",i.deletions??0]})]}):re&&l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontVariantNumeric:"tabular-nums",flex:"0 0 auto"},children:re}),y&&u&&l.jsx(sn,{size:"sm",value:x,onChange:p,tabs:[{value:"rendered",label:"Rendered"},{value:"source",label:"Source"}]}),S&&l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:2,flex:"0 0 auto",marginLeft:"var(--sp-1)"},children:[l.jsx(Ya,{icon:"chevronLeft",label:"Previous (←)",onClick:b??void 0,disabled:!b,size:"sm"}),l.jsxs("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontVariantNumeric:"tabular-nums",minWidth:"4.5ch",textAlign:"center"},children:[d+1," / ",h]}),l.jsx(Ya,{icon:"chevronRight",label:"Next (→)",onClick:k??void 0,disabled:!k,size:"sm"})]}),c&&!R&&l.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"none",flex:"0 0 auto"},children:l.jsx(le,{variant:"ghost",size:"sm",children:"Open in a new tab"})}),l.jsx(Ya,{icon:"close",label:"Close (Esc)",onClick:o,size:"sm"})]}),l.jsx("div",{style:{flex:1,minHeight:0,overflow:"auto",display:"flex",flexDirection:"column",background:z==="image"?"var(--bg-inset)":"var(--bg-card)"},children:B})]})})}function Wc(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(i<10*1024?1:0)} KB`:`${(i/1024/1024).toFixed(1)} MB`}function Cp(i,c){return`${i}/preview/${c.split("/").map(encodeURIComponent).join("/")}`}function Xc(i,c){return`${i}/artifact?path=${encodeURIComponent(c)}`}const P1={image:"image",text:"transcript",pdf:"file",other:"file"};function uv(i,c){const u=c?`${c}/`:"",o=new Map,d=[];for(const y of i){if(!y.path.startsWith(u))continue;const x=y.path.slice(u.length),p=x.indexOf("/");if(p<0){d.push(y);continue}const S=x.slice(0,p),b=o.get(S)??{name:S,count:0,sub:new Set};b.count+=1;const k=x.slice(p+1),w=k.indexOf("/");b.sub.add(w<0?"":k.slice(0,w)),o.set(S,b)}const h=(y,x)=>y.localeCompare(x,void 0,{sensitivity:"base",numeric:!0}),m=[...o.values()].sort((y,x)=>h(y.name,x.name)).map(y=>{let x=y.name,p=`${u}${y.name}`,S=y;for(;S.sub.size===1&&!S.sub.has("");){const[b]=[...S.sub],k=uv(i,p).dirs.find(w=>w.name===b);if(!k)break;x=`${x}/${b}`,p=`${p}/${b}`,S={sub:k.sub}}return{name:y.name,label:x,path:p,count:y.count,sub:y.sub}});return d.sort((y,x)=>h(y.path,x.path)),{dirs:m,files:d}}const eb={display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"5px 6px",width:"100%",fontSize:"var(--fs-sm)",color:"inherit",minWidth:0,background:"none",border:"none",borderRadius:"var(--r-sm)",cursor:"pointer",font:"inherit",textAlign:"left"};function Vc({onClick:i,title:c,children:u}){const[o,d]=g.useState(!1);return l.jsx("button",{type:"button",onClick:i,title:c,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),style:{...eb,background:o?"var(--bg-hover)":"none"},children:u})}const Qc={fontFamily:"var(--font-mono)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--ink-0)"},Tp={fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontVariantNumeric:"tabular-nums",flex:"0 0 auto"};function tb(i){if(!i?.length)return"";let c=i[0].path.split("/").slice(0,-1);for(const u of i){const o=u.path.split("/").slice(0,-1);let d=0;for(;d<c.length&&d<o.length&&c[d]===o[d];)d++;if(c=c.slice(0,d),!c.length)break}return c.join("/")}const Mp=9;function eu({files:i,truncated:c,loading:u,error:o,onRefresh:d,urlBase:h,initialDir:m="",summary:y,images:x=!0,style:p}){const[S,b]=g.useState(m),[k,w]=g.useState(null),[_,X]=g.useState(!1),[M,z]=g.useState(null),R=g.useMemo(()=>uv(i??[],S),[i,S]),N=g.useMemo(()=>x?(i??[]).filter(G=>G.kind==="image").sort((G,ce)=>(ce.mtimeMs??0)-(G.mtimeMs??0)):[],[i,x]),Z=_?N:N.slice(0,Mp),re={display:"flex",flexDirection:"column",gap:"var(--sp-2)",...p};if(o)return l.jsx("div",{style:re,children:l.jsxs(Qe,{children:["Could not list the folder: ",o]})});if(u&&!i?.length)return l.jsx("div",{style:re,children:l.jsx(Qe,{children:"Reading the folder…"})});const B=S?S.split("/"):[],L=k===null?null:R.files[k]??null,P=i?.length??0;return l.jsxs("div",{style:re,children:[y!==null&&l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",lineHeight:"var(--lh)"},children:[l.jsx("span",{style:{flex:1,minWidth:0},children:y??l.jsxs(l.Fragment,{children:[l.jsxs("span",{style:{color:"var(--ink-0)"},children:[P," file",P===1?"":"s"]})," in the folder as it stands · every run here shares them"]})}),d&&l.jsx("button",{type:"button",onClick:d,title:"Read the folder again",disabled:u,style:{background:"none",border:"none",padding:2,cursor:"pointer",color:"var(--ink-2)",display:"inline-flex"},children:l.jsx(ie,{name:u?"loading":"resume",size:13})})]}),c&&l.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--status-serious)"},children:"A large folder: only the first 2000 files are listed."}),N.length>0&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[l.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(88px, 1fr))",gap:6},children:Z.map((G,ce)=>l.jsxs("button",{type:"button",onClick:()=>z(ce),title:`${G.path} · ${Wc(G.size)}`,style:{display:"block",padding:0,width:"100%",cursor:"pointer",font:"inherit",border:"1px solid var(--line)",borderRadius:"var(--r-sm)",overflow:"hidden",background:"var(--bg-inset)",color:"inherit",textAlign:"left"},children:[l.jsx("img",{src:Xc(h,G.path),alt:G.path,loading:"lazy",style:{display:"block",width:"100%",aspectRatio:"4 / 3",objectFit:"cover"}}),l.jsx("div",{style:{padding:"2px 5px",fontSize:"var(--fs-xs)",fontFamily:"var(--font-mono)",color:"var(--ink-1)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:G.path.split("/").pop()})]},G.path))}),N.length>Mp&&l.jsx("button",{type:"button",onClick:()=>X(G=>!G),style:{alignSelf:"flex-start",background:"none",border:"none",padding:"0 2px",cursor:"pointer",font:"inherit",fontSize:"var(--fs-xs)",color:"var(--ink-2)",textDecoration:"underline"},children:_?"Fewer images":`All ${N.length} images`})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:2,padding:"4px 6px",border:"1px solid var(--line)",borderRadius:"var(--r-sm)",background:"var(--bg-inset)",fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",minWidth:0},children:[l.jsxs("button",{type:"button",onClick:()=>b(""),title:"The project folder",style:{background:"none",border:"none",padding:"1px 3px",cursor:S?"pointer":"default",color:S?"var(--ink-2)":"var(--ink-0)",display:"inline-flex",alignItems:"center",gap:4,font:"inherit"},children:[l.jsx(ie,{name:"folder",size:12}),!S&&l.jsx("span",{children:"/"})]}),B.map((G,ce)=>{const te=ce===B.length-1,ee=B.slice(0,ce+1).join("/");return l.jsxs(vn.Fragment,{children:[l.jsx("span",{style:{color:"var(--ink-2)"},children:"/"}),l.jsx("button",{type:"button",onClick:()=>b(ee),disabled:te,style:{background:"none",border:"none",padding:"1px 3px",cursor:te?"default":"pointer",color:te?"var(--ink-0)":"var(--ink-2)",font:"inherit",fontWeight:te?"var(--fw-semibold)":"inherit"},children:G})]},ee)})]}),l.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[S&&l.jsxs(Vc,{onClick:()=>b(B.slice(0,-1).join("/")),title:"Up one level",children:[l.jsx(ie,{name:"parent",size:13,color:"var(--ink-2)"}),l.jsx("span",{style:{...Qc,color:"var(--ink-2)"},children:".."})]}),R.dirs.map(G=>l.jsxs(Vc,{onClick:()=>b(G.path),title:`${G.path}/ · ${G.count} file${G.count===1?"":"s"}`,children:[l.jsx(ie,{name:"folder",size:13,color:"var(--brand)"}),l.jsx("span",{style:Qc,children:G.label}),l.jsx("span",{style:Tp,children:G.count}),l.jsx(ie,{name:"chevronRight",size:12,color:"var(--ink-2)"})]},G.path)),R.files.map((G,ce)=>l.jsxs(Vc,{onClick:()=>w(ce),title:`${G.path} · ${Wc(G.size)}`,children:[l.jsx(ie,{name:P1[G.kind]||"file",size:13,color:"var(--ink-2)"}),l.jsx("span",{style:Qc,children:G.path.slice(G.path.lastIndexOf("/")+1)}),l.jsx("span",{style:Tp,children:Wc(G.size)})]},G.path)),R.dirs.length===0&&R.files.length===0&&l.jsx(Qe,{children:S?"Nothing here.":"The folder is empty."})]}),M!==null&&Z[M]&&l.jsx(Pc,{artifact:Z[M],url:Xc(h,Z[M].path),previewUrl:Cp(h,Z[M].path),onClose:()=>z(null),index:M,count:Z.length,onStep:z}),L&&l.jsx(Pc,{artifact:L,url:Xc(h,L.path),previewUrl:Cp(h,L.path),onClose:()=>w(null),index:k,count:R.files.length,onStep:w})]})}const nb={added:"added",modified:"modified",deleted:"deleted",renamed:"renamed"},Ep={added:"var(--status-good)",deleted:"var(--status-critical)",modified:"var(--ink-1)",renamed:"var(--ink-1)"};function ab(i,c){return`${i}/artifact?path=${encodeURIComponent(c)}`}function lb({path:i,muted:c,strike:u}){const o=i.lastIndexOf("/"),d=o>=0?i.slice(0,o+1):"",h=o>=0?i.slice(o+1):i;return l.jsxs("span",{title:i,style:{fontFamily:"var(--font-mono)",display:"flex",minWidth:0,flex:1,color:c?"var(--ink-2)":"var(--ink-0)",textDecoration:u?"line-through":"none"},children:[d&&l.jsx("span",{style:{color:"var(--ink-2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,flex:"0 1 auto"},children:d}),l.jsx("span",{style:{whiteSpace:"nowrap",flex:"0 0 auto"},children:h})]})}const dv={display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"4px 6px",width:"100%",fontSize:"var(--fs-sm)",color:"inherit",minWidth:0,background:"none",border:"none",borderRadius:"var(--r-sm)",cursor:"pointer",font:"inherit",textAlign:"left"};function ib({onClick:i,title:c,children:u}){const[o,d]=g.useState(!1);return l.jsx("button",{type:"button",onClick:i,title:c,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),style:{...dv,background:o?"var(--bg-hover)":"none"},children:u})}function sb({runId:i,deck:c,loading:u,error:o,missing:d,services:h=[],urlBase:m,tree:y,style:x}){const p=m??`/runs/${encodeURIComponent(i)}`,[S,b]=g.useState(null),k={display:"flex",flexDirection:"column",gap:"var(--sp-3)",...x};if(o)return l.jsx("div",{style:k,children:l.jsxs(Qe,{children:["Could not read the working tree: ",o]})});if(d||!c&&!u)return l.jsx("div",{style:k,children:l.jsx(Qe,{children:"No file record for this run — the server has no baseline for it."})});if(!c)return l.jsx("div",{style:k,children:l.jsx(Qe,{children:"Reading the working tree…"})});const{files:w,artifacts:_,totals:X}=c,M=w.map(B=>({...B,kind:"diff"})),z=B=>b(B),R=S===null?null:M[S]??null,N=new Set((y?.files??[]).map(B=>B.path)),Z=[...y?.files??[],..._.filter(B=>!N.has(B.path))],re=(c.baseline.kind==="git"&&c.baseline.head?`against ${String(c.baseline.head).slice(0,8)}`:c.baseline.kind==="snapshot"?"against a snapshot at run start":"no baseline")+(c.frozenAt?` · as it ended ${new Date(c.frozenAt).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}`:"");return l.jsxs("div",{style:k,children:[l.jsxs("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontVariantNumeric:"tabular-nums",lineHeight:"var(--lh)"},children:[l.jsxs("span",{style:{color:"var(--ink-0)"},children:[X.files," changed · ",l.jsxs("span",{style:{color:"var(--status-good)"},children:["+",X.additions]})," ",l.jsxs("span",{style:{color:"var(--status-critical)"},children:["−",X.deletions]})," · ",_.length," artifact",_.length===1?"":"s"]})," ",l.jsx("span",{children:re}),c.note&&l.jsx("div",{style:{color:"var(--status-serious)"},children:c.note})]}),h.length>0&&l.jsxs("section",{children:[l.jsx(pn,{children:"Services"}),l.jsx("div",{style:{display:"flex",flexDirection:"column"},children:h.map(B=>l.jsxs("a",{href:B.url??B.path,target:"_blank",rel:"noopener noreferrer",title:`${B.label} — 127.0.0.1:${B.port} through Foreman`,style:{...dv,textDecoration:"none"},children:[l.jsx(ie,{name:"provider",size:12,color:"var(--status-good)"}),l.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--ink-0)"},children:B.label}),l.jsxs("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontFamily:"var(--font-mono)",flex:"0 0 auto"},children:[":",B.port]})]},B.port))})]}),l.jsxs("section",{children:[l.jsx(pn,{children:"Changed files"}),w.length===0&&l.jsx(Qe,{children:"Nothing changed in the folder yet."}),l.jsx("div",{style:{display:"flex",flexDirection:"column"},children:w.map((B,L)=>l.jsxs(ib,{onClick:()=>z(L),title:B.binary?`${B.path} — binary, no diff`:B.preexisting?`${B.path} — also dirty before the run`:`${B.path} — open the diff`,children:[l.jsx(ie,{name:"file",size:12,color:"var(--ink-2)"}),l.jsx(lb,{path:B.path,muted:B.status==="deleted",strike:B.status==="deleted"}),l.jsx("span",{style:{fontSize:"var(--fs-xs)",padding:"0 5px",borderRadius:"var(--r-pill)",lineHeight:"15px",border:`1px solid ${Ep[B.status]||"var(--line-strong)"}`,color:Ep[B.status]||"var(--ink-1)",flex:"0 0 auto"},children:B.binary?"binary":nb[B.status]||B.status}),l.jsxs("span",{style:{fontVariantNumeric:"tabular-nums",fontSize:"var(--fs-xs)",fontFamily:"var(--font-mono)",flex:"0 0 auto"},children:[l.jsxs("span",{style:{color:"var(--status-good)"},children:["+",B.additions]})," ",l.jsxs("span",{style:{color:"var(--status-critical)"},children:["−",B.deletions]})]})]},`${B.status}:${B.path}`))})]}),l.jsxs("section",{children:[l.jsx(pn,{children:"Folder"}),y?l.jsx(eu,{files:Z,truncated:y.truncated,loading:y.loading,error:y.error,onRefresh:y.refresh,urlBase:p,summary:l.jsxs(l.Fragment,{children:[l.jsxs("span",{style:{color:"var(--ink-0)"},children:[Z.length," file",Z.length===1?"":"s"]})," as the folder stands · the run's work files included"]})},i):_.length===0?l.jsx(Qe,{children:"No screenshots or work files yet."}):l.jsx(eu,{files:_,urlBase:p,initialDir:tb(_),summary:null},i)]}),R&&l.jsx(Pc,{artifact:R,url:R.kind==="diff"&&!R.binary?void 0:ab(p,R.path),previewUrl:void 0,onClose:()=>b(null),index:S,count:M.length,onStep:b})]})}const rb=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function fv(i){if(!i||typeof i!="object")return"no cadence";switch(i.kind){case"daily":return`daily ${i.at}`;case"weekly":return`every ${rb[i.day]??`day ${i.day}`} ${i.at}`;case"interval":{const c=Number(i.everyMinutes)||0;return c%60===0?c===60?"every hour":`every ${c/60} hours`:`every ${c} minutes`}case"cron":return`cron ${i.expr}`;default:return"no cadence"}}function ob({cadence:i}){return i&&i.kind==="cron"?l.jsxs(l.Fragment,{children:["cron ",l.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:i.expr})]}):l.jsx(l.Fragment,{children:fv(i)})}function cb(i,c=Date.now()){if(!i)return null;const u=i-c;if(u<=0)return"due now";const o=Math.round(u/6e4);if(o<1)return"any moment now";if(o<60)return`in ${o} min`;const d=Math.round(o/60);return d<36?`in ${d} h`:`in ${Math.round(d/24)} days`}function Rl(i){const c=Number(i)||0;return`$${Number.isInteger(c)?c:c.toFixed(2)}`}const ub={failures:"paused — two runs in a row failed","monthly-cap":"paused — this month's scheduled spend would pass the ceiling",human:"paused by you"},_p={done:"var(--status-good)",error:"var(--status-critical)",interrupted:"var(--status-serious)",skipped:"var(--ink-2)"};function db({children:i,color:c,title:u,icon:o}){return l.jsxs("span",{title:u,style:{display:"inline-flex",alignItems:"center",gap:3,padding:"0 6px",borderRadius:"var(--r-pill)",border:`1px solid ${c??"var(--line-strong)"}`,color:c??"var(--ink-1)",fontSize:"var(--fs-xs)",lineHeight:"16px",flex:"0 0 auto",whiteSpace:"nowrap"},children:[o&&l.jsx(ie,{name:o,size:10}),i]})}function fb({s:i,projectId:c,onEdit:u,onPause:o,onResume:d,onRunNow:h,onDelete:m}){const[y,x]=g.useState(""),[p,S]=g.useState(""),[b,k]=g.useState(!1),w=!i.enabled||!!i.pausedReason,_=ub[i.pausedReason]??(w?"paused — it will not fire until you resume it":null),X=async(z,R)=>{x(z),S("");try{const N=await R();N&&S(N)}catch(N){S(N instanceof Error?N.message:String(N))}finally{x("")}},M=w?null:cb(i.nextRunAt);return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"var(--sp-2)",border:"1px solid var(--line)",borderRadius:"var(--r-sm)",background:w?"var(--bg-inset)":"var(--bg-card)",minWidth:0},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",minWidth:0},children:[l.jsx("span",{title:i.brief,style:{fontSize:"var(--fs-sm)",color:w?"var(--ink-1)":"var(--ink-0)",fontWeight:"var(--fw-semibold)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,flex:1},children:i.name}),w&&l.jsx(db,{icon:"interrupted",color:"var(--ink-2)",title:_,children:"paused"})]}),l.jsxs("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",lineHeight:"var(--lh)"},children:[l.jsx("span",{title:`One run costs at most ${Rl(i.budgetUsd)}`,children:l.jsx(ob,{cadence:i.cadence})}),M&&l.jsxs(l.Fragment,{children:[" · ",l.jsx("span",{style:{color:"var(--ink-1)"},children:M})]})," · ",l.jsxs("span",{children:[Rl(i.budgetUsd)," a run"]})]}),w&&l.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-1)"},children:_}),i.lastOutcome&&l.jsxs("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:["last:"," ",i.lastRunId?l.jsx("a",{href:`#/p/${encodeURIComponent(i.projectId??c)}/r/${encodeURIComponent(i.lastRunId)}`,title:i.lastNote||`Open the run that ${i.lastOutcome==="done"?"finished":"ended"} ${i.lastRunAt?new Date(i.lastRunAt).toLocaleString():""}`,style:{color:_p[i.lastOutcome]??"var(--ink-1)",textDecoration:"underline"},children:i.lastOutcome}):l.jsx("span",{style:{color:_p[i.lastOutcome]??"var(--ink-1)"},children:i.lastOutcome}),i.lastRunAt&&l.jsxs("span",{children:[" · ",new Date(i.lastRunAt).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})]})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,flexWrap:"wrap"},children:[w?l.jsx(le,{variant:"good",size:"sm",icon:"resume",disabled:!!y,title:`Resume ${i.name} — it fires again on its cadence`,onClick:()=>{X("resume",()=>d(i))},children:y==="resume"?"Resuming…":"Resume"}):l.jsx(le,{variant:"default",size:"sm",icon:"interrupted",disabled:!!y,title:`Pause ${i.name} — it stops firing until you resume it`,onClick:()=>{X("pause",()=>o(i))},children:y==="pause"?"Pausing…":"Pause"}),l.jsx(le,{variant:"default",size:"sm",icon:"now",disabled:!!y,title:`Start this mission now, once — ${Rl(i.budgetUsd)} cap. The cadence is unchanged.`,onClick:()=>{X("run",()=>h(i))},children:y==="run"?"Starting…":"Run now"}),l.jsx(le,{variant:"ghost",size:"sm",icon:"write",disabled:!!y,title:`Edit ${i.name} — brief, cadence, budget, models`,onClick:()=>u(i),children:"Edit"}),l.jsx(le,{variant:"ghost",size:"sm",icon:"unlink",disabled:!!y,title:`Delete ${i.name} — asks first`,onClick:()=>k(!0),children:"Delete"})]}),p&&l.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--status-critical)"},children:p}),b&&l.jsx(rv,{title:`Delete ${i.name}?`,body:"This schedule stops existing and never fires again. The runs it already started are kept.",confirmLabel:"Delete",icon:"unlink",onCancel:()=>k(!1),onConfirm:()=>{k(!1),X("delete",()=>m(i))}})]})}function hb({schedules:i=[],monthSpendUsd:c=0,monthlyCapUsd:u=0,loading:o,error:d,projectId:h,onNew:m,onEdit:y,onPause:x,onResume:p,onRunNow:S,onDelete:b,style:k}){const w=u>0&&c>=u;return l.jsxs("section",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)",minWidth:0,...k},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",minWidth:0},children:[l.jsx(pn,{style:{flex:"0 0 auto"},children:"Schedules"}),l.jsx("span",{style:{flex:1}}),l.jsx(le,{variant:"ghost",size:"sm",icon:"add",title:"Write a new standing instruction for this project",onClick:m,children:"New"})]}),(u>0||c>0)&&l.jsx("div",{title:"Scheduled runs only. At the ceiling, schedules pause themselves rather than spend past it.",style:{fontSize:"var(--fs-xs)",fontVariantNumeric:"tabular-nums",color:w?"var(--status-serious)":"var(--ink-2)"},children:u>0?l.jsxs(l.Fragment,{children:[Rl(c)," of ",Rl(u)," this month",w&&" — at the ceiling"]}):l.jsxs(l.Fragment,{children:[Rl(c)," this month · no ceiling set"]})}),d?l.jsxs(Qe,{children:["Could not read the schedules: ",d]}):o&&i.length===0?l.jsx(Qe,{children:"Reading the schedules…"}):i.length===0?l.jsx(Qe,{children:"Nothing standing. A schedule starts an ordinary mission here on a cadence — nightly dependency checks, a Monday morning review — and pauses itself when it fails twice or would pass the month's ceiling."}):l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:i.map(_=>l.jsx(fb,{s:_,projectId:h,onEdit:y,onPause:x,onResume:p,onRunNow:S,onDelete:b},_.id))})]})}const pb=[{day:1,short:"Mon"},{day:2,short:"Tue"},{day:3,short:"Wed"},{day:4,short:"Thu"},{day:5,short:"Fri"},{day:6,short:"Sat"},{day:0,short:"Sun"}],Dp=/^([01]\d|2[0-3]):([0-5]\d)$/;function vb(i){const c={kind:"daily",at:"09:00",day:1,hours:6,expr:"0 9 * * 1"};return i?i.kind==="daily"?{...c,kind:"daily",at:i.at}:i.kind==="weekly"?{...c,kind:"weekly",at:i.at,day:i.day}:i.kind==="interval"?{...c,kind:"interval",hours:Math.max(1,Math.round((i.everyMinutes??60)/60))}:i.kind==="cron"?{...c,kind:"cron",expr:i.expr}:c:c}function mb(i){if(i.kind==="daily")return Dp.test(i.at)?{kind:"daily",at:i.at}:null;if(i.kind==="weekly")return Dp.test(i.at)?{kind:"weekly",day:i.day,at:i.at}:null;if(i.kind==="interval"){const c=Number(i.hours);return Number.isFinite(c)&&c>=1?{kind:"interval",everyMinutes:Math.round(c)*60}:null}return i.kind==="cron"&&i.expr.trim()?{kind:"cron",expr:i.expr.trim()}:null}function gb(i){return new Date(i).toLocaleString(void 0,{weekday:"short",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function yb({schedule:i,models:c,modelsLoading:u,modelsNote:o,modelsInheritNote:d,defaultBudgetUsd:h=6,onPreview:m,onSave:y,onClose:x}){const p=!!i,[S,b]=g.useState(i?.name??""),[k,w]=g.useState(i?.brief??""),[_,X]=g.useState(()=>vb(i?.cadence)),[M,z]=g.useState(i?.budgetUsd??h),[R,N]=g.useState(i?.directorModel??""),[Z,re]=g.useState(i?.workerModel??""),[B,L]=g.useState(i?.directorProviderId),[P,G]=g.useState(i?.workerProviderId),[ce,te]=g.useState(i?i.enabled!==!1:!0),[ee,xe]=g.useState(!1),[se,me]=g.useState(""),[j,q]=g.useState({next:[],error:"",loading:!1}),O=g.useMemo(()=>mb(_),[_]),ue=O?JSON.stringify(O):"";g.useEffect(()=>{if(!O||!m){q({next:[],error:"",loading:!1});return}let A=!1;q({next:[],error:"",loading:!0});const F=setTimeout(()=>{Promise.resolve(m(O)).then(ne=>{A||q({next:ne?.next??[],error:ne?.error??"",loading:!1})}).catch(ne=>{A||q({next:[],error:ne instanceof Error?ne.message:String(ne),loading:!1})})},300);return()=>{A=!0,clearTimeout(F)}},[ue]);const he=!!(O&&j.error),T=S.trim()?k.trim()?O?Number(M)>0?"":"A run needs a budget cap.":_.kind==="interval"?"Hours must be a whole number, one or more.":_.kind==="cron"?"Write a five-field cron expression.":"Time must read as HH:MM, like 07:30.":"Say what the mission should do.":"Give it a name.",Q=async()=>{if(T){me(T);return}xe(!0),me("");try{const A=await y({name:S.trim(),brief:k.trim(),cadence:O,budgetUsd:Number(M),directorModel:R||void 0,workerModel:Z||void 0,directorProviderId:B||void 0,workerProviderId:P||void 0,enabled:ce});A?me(A):x?.()}catch(A){me(A instanceof Error?A.message:String(A))}finally{xe(!1)}};return l.jsxs(Nl,{width:640,onClose:ee?void 0:x,children:[l.jsxs(gr,{children:[l.jsx("div",{style:{fontSize:"var(--fs-md)",fontWeight:"var(--fw-semibold)",color:"var(--ink-0)"},children:p?"Edit schedule":"New schedule"}),l.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",marginTop:2},children:"A standing instruction: Foreman starts this mission on its own, on this cadence, with nobody watching."})]}),l.jsxs("div",{style:{padding:"var(--sp-3)",overflowY:"auto",display:"flex",flexDirection:"column",gap:"var(--sp-3)"},children:[l.jsx(vt,{layout:"stacked",label:"Name",hint:"What it is called in the rail and in the notification.",children:l.jsx(Be,{value:S,onChange:b,placeholder:"Nightly dependency check",autoFocus:!0})}),l.jsx(vt,{layout:"stacked",label:"Brief",hint:"The mission, written as you would write it in the composer.",children:l.jsx(ru,{value:k,onChange:w,size:"answer",style:{height:120,minHeight:72},placeholder:"Check for outdated dependencies, open a branch with the safe upgrades, run the tests."})}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:[l.jsx(sn,{size:"sm",value:_.kind,onChange:A=>X({..._,kind:A}),tabs:[{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"interval",label:"Every N hours"},{value:"cron",label:"Cron"}]}),l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"var(--sp-3)",flexWrap:"wrap"},children:[(_.kind==="daily"||_.kind==="weekly")&&l.jsx(vt,{layout:"stacked",label:"At",hint:"24-hour clock, this machine's time zone.",children:l.jsx(Be,{value:_.at,onChange:A=>X({..._,at:A}),width:96,mono:!0,placeholder:"07:30"})}),_.kind==="weekly"&&l.jsx(vt,{layout:"stacked",label:"Day",hint:"Which day of the week it fires.",children:l.jsx("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:pb.map(A=>l.jsx(le,{size:"sm",variant:_.day===A.day?"primary":"default",title:`Every ${A.short}`,onClick:()=>X({..._,day:A.day}),children:A.short},A.day))})}),_.kind==="interval"&&l.jsx(vt,{layout:"stacked",label:"Every",hint:"Hours between runs. One hour is the shortest Foreman allows.",children:l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[l.jsx(Be,{type:"number",min:1,step:1,width:96,value:_.hours,onChange:A=>X({..._,hours:A})}),l.jsx("span",{style:{fontSize:"var(--fs-sm)",color:"var(--ink-2)"},children:"hours"})]})}),_.kind==="cron"&&l.jsx(vt,{layout:"stacked",label:"Expression",hint:"Five fields: minute hour day-of-month month day-of-week.",children:l.jsx(Be,{value:_.expr,mono:!0,onChange:A=>X({..._,expr:A}),placeholder:"0 9 * * 1"})})]}),l.jsx("div",{style:{padding:"var(--sp-2)",background:"var(--bg-inset)",border:"1px solid var(--line)",borderRadius:"var(--r-sm)",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:j.error?l.jsxs("span",{style:{color:"var(--status-critical)",display:"inline-flex",alignItems:"center",gap:4},children:[l.jsx(ie,{name:"warning",size:11}),j.error]}):O?j.loading&&j.next.length===0?l.jsx("span",{children:"Working out the next three runs…"}):j.next.length===0?l.jsx("span",{children:"Nothing scheduled from this cadence."}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{style:{color:"var(--ink-1)"},children:[fv(O)," — next three runs:"]}),l.jsx("div",{style:{fontVariantNumeric:"tabular-nums"},children:j.next.slice(0,3).map(A=>l.jsx("div",{children:gb(A)},A))})]}):l.jsx("span",{children:"Next three runs appear once the cadence reads."})})]}),l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"var(--sp-4)",flexWrap:"wrap"},children:[l.jsx(vt,{layout:"stacked",label:"Budget cap",hint:"Per run, not per month. The run halts here.",children:l.jsx(Be,{type:"number",min:1,step:1,width:96,prefix:"$",value:M,onChange:z})}),l.jsx(vt,{layout:"stacked",label:"Director",hint:"Plans, delegates, verifies.",children:l.jsx($t,{value:R,models:c,loading:u,note:o,inheritNote:d,onChange:(A,F)=>{N(A),L(F?.providerId)}})}),l.jsx(vt,{layout:"stacked",label:"Workers",hint:"Implement. Cheaper models cut cost.",children:l.jsx($t,{value:Z,models:c,loading:u,note:o,inheritNote:d,onChange:(A,F)=>{re(A),G(F?.providerId)}})})]})]}),l.jsxs(Ul,{children:[l.jsxs("span",{title:"Off keeps the schedule but stops it firing.",style:{display:"inline-flex",alignItems:"center",gap:6,flex:"0 0 auto"},children:[l.jsx(xt,{checked:ce,onChange:te,disabled:ee,size:"sm",label:"Enabled"}),l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:ce?"var(--ink-1)":"var(--ink-2)"},children:ce?"Enabled":"Paused"})]}),(se||T)&&l.jsx("span",{title:se||T,style:{fontSize:"var(--fs-xs)",color:se?"var(--status-critical)":"var(--ink-2)",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:se||T}),l.jsx("span",{style:{marginLeft:"auto"}}),l.jsx(le,{variant:"ghost",disabled:ee,onClick:x,children:"Cancel"}),l.jsx(le,{variant:"primary",disabled:ee||!!T||he,title:T||(he?`The server will not take this cadence: ${j.error}`:"")||(p?"Save the changes":"Create this schedule"),onClick:()=>{Q()},children:ee?"Saving…":p?"Save":"Create"})]})]})}const xb=[{value:"default",label:"Server default"},{value:"claude-code",label:"Claude Code",icon:"model"},{value:"anthropic-api",label:"Anthropic API",icon:"budget"},{value:"codex",label:"Codex",icon:"Bash"},{value:"openai-compatible",label:"Custom endpoint",icon:"WebFetch"}];function bb(i){const c=`pr-${Math.random().toString(16).slice(2,10)}`;switch(i){case"claude-code":return{kind:i};case"anthropic-api":return{kind:i,id:c,apiKeyEnv:""};case"codex":return{kind:i,id:c};case"openai-compatible":return{kind:i,id:c,baseUrl:""};default:return null}}function Ap(){return l.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",marginTop:4},children:"Names an environment variable on the server. A stored key below takes precedence; leave both empty and this endpoint needs no credential."})}function Rp({providerId:i,hasKey:c,busy:u,error:o,onStore:d,onClear:h}){const[m,y]=g.useState(""),[x,p]=g.useState(!1);return!d||!i?null:l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",flexWrap:"wrap"},children:[l.jsx("span",{style:{fontSize:"var(--fs-sm)",color:"var(--ink-1)"},children:c?"A key is stored for this provider.":"No key stored."}),c&&l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:"It cannot be shown — only replaced or removed."}),l.jsxs("span",{style:{marginLeft:"auto",display:"inline-flex",gap:"var(--sp-2)"},children:[l.jsx(le,{size:"sm",variant:"ghost",onClick:()=>p(S=>!S),children:x?"Cancel":c?"Replace":"Add a key"}),c&&l.jsx(le,{size:"sm",variant:"danger",disabled:u,onClick:()=>h?.(i),children:"Remove"})]})]}),x&&l.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",alignItems:"center"},children:[l.jsx(Be,{mono:!0,type:"password",placeholder:"paste the key",value:m,onChange:y,autoFocus:!0,onKeyDown:S=>{S.key==="Enter"&&m.trim()&&(d(i,m.trim()),y(""),p(!1))}}),l.jsx(le,{size:"sm",variant:"good",disabled:u||!m.trim(),onClick:()=>{d(i,m.trim()),y(""),p(!1)},children:u?"Saving…":"Save key"})]}),o&&l.jsx(Fe,{tone:"error",inline:!0,children:o})]})}function Pt({label:i,children:c}){return l.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:4},children:[l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:i}),c]})}function jb({inst:i,selected:c,onClick:u}){const[o,d]=g.useState(!1);return l.jsxs("button",{type:"button",onClick:u,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),style:{display:"flex",alignItems:"center",gap:8,textAlign:"left",width:"100%",padding:"6px 8px",borderRadius:"var(--r-sm)",cursor:"pointer",font:"inherit",background:c?"var(--brand-wash-strong)":o?"var(--bg-hover)":"transparent",border:`1px solid ${c?"var(--brand)":"var(--line)"}`},children:[l.jsx(ie,{name:"model",size:13,color:c?"var(--brand)":"var(--ink-2)"}),l.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-sm)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:i.configDir,children:mr(i.configDir)}),l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:i.origin}),i.hasStoredLogin&&l.jsx("span",{title:"Has a stored login",style:{width:6,height:6,borderRadius:"var(--r-pill)",background:"var(--status-good)",flex:"0 0 auto"}})]})}function Sb({value:i,onChange:c,instances:u,ollama:o,hasKey:d,keyBusy:h,keyError:m,onStoreKey:y,onClearKey:x,style:p}){const[S,b]=g.useState(!1),k=i?.kind??"default",w=M=>c({...i,...M}),_=M=>c(bb(M)),X=k==="openai-compatible"&&o&&i.baseUrl===o.host;return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)",...p},children:[l.jsx(sn,{size:"sm",value:k,onChange:_,tabs:xb}),k==="default"&&l.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:"Runs on whatever the server itself authenticates as."}),k==="claude-code"&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:[u?.length>0&&l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:u.map(M=>l.jsx(jb,{inst:M,selected:(i.configDir??"")===M.configDir,onClick:()=>w({configDir:M.configDir})},M.configDir))}),l.jsx(Pt,{label:"Config dir (blank inherits the server's own install)",children:l.jsx(Be,{mono:!0,placeholder:"~/.claude-work",value:i.configDir??"",onChange:M=>w({configDir:M||void 0})})}),S?l.jsx(Pt,{label:"Executable (blank uses the SDK's bundled one)",children:l.jsx(Be,{mono:!0,placeholder:"/usr/local/bin/claude",value:i.executable??"",onChange:M=>w({executable:M||void 0})})}):l.jsx("button",{type:"button",onClick:()=>b(!0),style:{alignSelf:"flex-start",background:"none",border:0,padding:0,font:"inherit",fontSize:"var(--fs-xs)",color:"var(--ink-2)",cursor:"pointer",textDecoration:"underline",textUnderlineOffset:2},children:"Pin an executable too"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[l.jsx(xt,{checked:!!i.ownLogin,onChange:M=>w({ownLogin:M||void 0})}),l.jsx("span",{style:{fontSize:"var(--fs-sm)"},children:"Own login"})]}),l.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:"Strips any inherited API key from this project's agents so this install's own stored subscription pays, instead of whatever the server process authenticates as."})]}),k==="anthropic-api"&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:[l.jsx(Rp,{providerId:i.id,hasKey:d,busy:h,error:m,onStore:y,onClear:x}),l.jsx(Pt,{label:"Environment variable (optional fallback)",children:l.jsx(Be,{mono:!0,placeholder:"ANTHROPIC_API_KEY_ALPHA",value:i.apiKeyEnv??"",onChange:M=>w({apiKeyEnv:M})})}),l.jsx(Ap,{}),l.jsx(Pt,{label:"Model (blank uses the provider's default)",children:l.jsx(Be,{mono:!0,placeholder:"claude-sonnet-4-5",value:i.model??"",onChange:M=>w({model:M||void 0})})})]}),k==="codex"&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:[l.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:"Reads the login `codex login` already stored — Foreman never mints its own token."}),l.jsx(Pt,{label:"Codex home (blank is ~/.codex)",children:l.jsx(Be,{mono:!0,placeholder:"~/.codex",value:i.codexHome??"",onChange:M=>w({codexHome:M||void 0})})}),S?l.jsx(Pt,{label:"Upstream URL (blank is the public ChatGPT backend)",children:l.jsx(Be,{mono:!0,placeholder:"https://chatgpt.com/backend-api/codex",value:i.upstreamUrl??"",onChange:M=>w({upstreamUrl:M||void 0})})}):l.jsx("button",{type:"button",onClick:()=>b(!0),style:{alignSelf:"flex-start",background:"none",border:0,padding:0,font:"inherit",fontSize:"var(--fs-xs)",color:"var(--ink-2)",cursor:"pointer",textDecoration:"underline",textUnderlineOffset:2},children:"Point at a different upstream"}),l.jsx(Pt,{label:"Model (blank uses Codex's own default)",children:l.jsx(Be,{mono:!0,placeholder:"gpt-5-codex",value:i.model??"",onChange:M=>w({model:M||void 0})})})]}),k==="openai-compatible"&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:[o&&l.jsxs("button",{type:"button",onClick:()=>w({baseUrl:o.host,label:"Ollama"}),style:{display:"flex",alignItems:"center",gap:8,textAlign:"left",width:"100%",padding:"6px 8px",borderRadius:"var(--r-sm)",cursor:"pointer",font:"inherit",background:X?"var(--brand-wash-strong)":"transparent",border:`1px solid ${X?"var(--brand)":"var(--line)"}`},children:[l.jsx(ie,{name:"Bash",size:13,color:X?"var(--brand)":"var(--ink-2)"}),l.jsx("span",{style:{fontSize:"var(--fs-sm)",flex:1},children:"Use local Ollama"}),l.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:[o.host," · ",o.models.length," model",o.models.length===1?"":"s"]})]}),l.jsx(Pt,{label:"Base URL",children:l.jsx(Be,{mono:!0,placeholder:"http://127.0.0.1:11434",value:i.baseUrl??"",onChange:M=>w({baseUrl:M})})}),X&&o.models.length>0?l.jsx(Pt,{label:"Model (blank lets the run pick)",children:l.jsxs("select",{value:i.model??"",onChange:M=>w({model:M.target.value||void 0}),style:{font:"inherit",fontFamily:"var(--font-mono)",fontSize:"var(--fs-sm)",padding:"6px 8px",borderRadius:"var(--r-sm)",border:"1px solid var(--line-strong)",background:"var(--bg-card)",color:"var(--ink-0)"},children:[l.jsx("option",{value:"",children:"— server picks —"}),o.models.map(M=>l.jsxs("option",{value:M.id,children:[M.id,M.remote?" (cloud)":""]},M.id))]})}):l.jsx(Pt,{label:"Model (blank lets the run pick)",children:l.jsx(Be,{mono:!0,placeholder:"llama3.1",value:i.model??"",onChange:M=>w({model:M||void 0})})}),l.jsx(Pt,{label:"Label (shown in place of the raw URL)",children:l.jsx(Be,{placeholder:"OpenRouter",value:i.label??"",onChange:M=>w({label:M||void 0})})}),l.jsx(Pt,{label:"Environment variable (blank when the endpoint needs no key)",children:l.jsx(Be,{mono:!0,placeholder:"OPENROUTER_API_KEY",value:i.apiKeyEnv??"",onChange:M=>w({apiKeyEnv:M||void 0})})}),!!i.apiKeyEnv&&l.jsx(Ap,{}),l.jsx(Rp,{providerId:i.id,hasKey:d,busy:h,error:m,onStore:y,onClear:x}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",fontSize:"var(--fs-sm)"},children:[l.jsx(xt,{checked:i.needsKey===!0,onChange:M=>w({needsKey:M||void 0})}),"This endpoint requires a credential"]})]})]})}function kb({status:i,busy:c,error:u,onSaveToken:o,onClearToken:d,onLink:h,onUnlink:m,onTest:y,onSavePublicUrl:x,style:p}){const[S,b]=g.useState(""),[k,w]=g.useState(!1),[_,X]=g.useState(null),M=i?.telegram,z=!!M?.hasToken,R=!!M?.chatId,N=M?.linking,Z=_??i?.publicUrl??"",re=_!==null&&_!==(i?.publicUrl??""),B=(L,P,G)=>l.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"var(--sp-3)",padding:"var(--sp-2) 0",borderTop:"1px solid var(--line)"},children:[l.jsxs("div",{style:{flex:"0 0 180px"},children:[l.jsx("div",{style:{fontSize:"var(--fs-sm)",color:"var(--ink-0)"},children:L}),P&&l.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",lineHeight:"var(--lh)"},children:P})]}),l.jsx("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:6},children:G})]});return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)",marginTop:"var(--sp-3)",...p},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:"var(--fs-sm)",fontWeight:"var(--fw-semibold)"},children:[l.jsx(ie,{name:"send",size:13,color:"var(--brand)"})," Telegram",l.jsxs("span",{style:{marginLeft:"auto",fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontWeight:"var(--fw-normal)"},children:[R?`linked · ${M.chatLabel||M.chatId}`:z?"token stored · not linked":"not set up",i?.delivered?` · ${i.delivered} sent`:"",i?.failures?` · ${i.failures} failed`:""]})]}),l.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",lineHeight:"var(--lh-prose)"},children:"Approvals, questions, stalls and finished missions arrive in a chat with your own bot, using the toggles above. Every ask still has its unattended default — this makes it less likely to be needed."}),u&&l.jsx(Fe,{tone:"error",inline:!0,children:u}),B("Bot token",l.jsxs(l.Fragment,{children:["Create a bot with ",l.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:"@BotFather"})," and paste its token. Stored write-only; Foreman can replace it but never show it."]}),z&&!k?l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",fontSize:"var(--fs-sm)"},children:[l.jsx("span",{style:{fontFamily:"var(--font-mono)",color:"var(--ink-1)"},children:M?.bot||"token stored"}),l.jsx(le,{size:"sm",variant:"ghost",onClick:()=>w(!0),disabled:c,children:"Replace"}),l.jsx(le,{size:"sm",variant:"ghost",onClick:d,disabled:c,children:"Remove"})]}):l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[l.jsx(Be,{mono:!0,type:"password",width:320,placeholder:"123456789:AA…",value:S,onChange:b}),l.jsx(le,{size:"sm",variant:"primary",disabled:c||!S.trim(),onClick:()=>{o?.(S.trim()),b(""),w(!1)},children:c?"Checking…":"Save"}),z&&l.jsx(le,{size:"sm",variant:"ghost",onClick:()=>w(!1),children:"Cancel"})]})),B("Linked chat","Send the one-time command to your bot from the chat that should receive messages. Only that chat is ever written to.",R?l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",fontSize:"var(--fs-sm)"},children:[l.jsx(ie,{name:"check",size:13,color:"var(--status-ok, var(--brand))"}),l.jsxs("span",{children:[M.chatLabel||"linked"," ",l.jsx("span",{style:{color:"var(--ink-2)",fontFamily:"var(--font-mono)"},children:M.chatId})]}),l.jsx(le,{size:"sm",variant:"ghost",onClick:y,disabled:c,children:"Send test"}),l.jsx(le,{size:"sm",variant:"ghost",onClick:m,disabled:c,children:"Unlink"})]}):N?l.jsxs("div",{style:{display:"flex",gap:"var(--sp-3)",alignItems:"flex-start"},children:[N.deepLink&&l.jsx("a",{href:N.deepLink,target:"_blank",rel:"noreferrer",title:"Open in Telegram",style:{flex:"0 0 auto",display:"block",padding:6,background:"#fff",borderRadius:"var(--r-sm)",border:"1px solid var(--line-strong)",lineHeight:0},children:l.jsx("img",{src:`/notify/telegram/qr.svg?c=${encodeURIComponent(N.code)}`,alt:`QR: ${N.deepLink}`,width:132,height:132,style:{display:"block"}})}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,fontSize:"var(--fs-sm)",minWidth:0},children:[l.jsx("div",{children:"Scan with your phone, or send this to your bot:"}),l.jsxs("code",{style:{alignSelf:"flex-start",fontFamily:"var(--font-mono)",fontSize:"var(--fs-lg)",padding:"4px 10px",background:"var(--bg-inset)",border:"1px solid var(--line-strong)",borderRadius:"var(--r-sm)"},children:["/start ",N.code]}),N.deepLink&&l.jsx("a",{href:N.deepLink,target:"_blank",rel:"noreferrer",style:{fontSize:"var(--fs-xs)",color:"var(--brand)",textDecoration:"none"},children:"Open in Telegram on this computer →"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:"var(--fs-xs)",color:"var(--ink-2)",flexWrap:"wrap"},children:[l.jsx("span",{className:"pulse",style:{display:"inline-flex"},children:l.jsx(ie,{name:"loading",size:12})}),"waiting… the code expires in 10 minutes",l.jsx(le,{size:"sm",variant:"ghost",onClick:h,disabled:c,children:"New code"})]})]})]}):l.jsx("div",{children:l.jsx(le,{size:"sm",variant:"primary",onClick:h,disabled:c||!z,title:z?"Shows a one-time code to send to your bot":"Store a bot token first",children:"Link a chat"})})),B("Foreman URL","Where links in messages point. A phone cannot open localhost — use a LAN or Tailscale address if you have one.",l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[l.jsx(Be,{mono:!0,width:320,value:Z,onChange:X,placeholder:"http://localhost:4177"}),l.jsx(le,{size:"sm",disabled:c||!re,onClick:()=>{x?.(Z),X(null)},children:"Save"})]}))]})}const Kc=[{id:"provider",label:"Provider",icon:"provider"},{id:"models",label:"Models",icon:"model"},{id:"budget",label:"Budget",icon:"budget"},{id:"approvals",label:"Approvals",icon:"approval"},{id:"appearance",label:"Appearance",icon:"sun"},{id:"notifications",label:"Notifications",icon:"needsYou"},{id:"projects",label:"Projects",icon:"folder"}],tu={directorModel:"opus",workerModel:"sonnet",plannerModel:"sonnet",budgetCap:5,budgetWarnAt:60,budgetHardStop:!0,scheduledMonthlyCapUsd:25,autoAllowReadOnly:!0,alwaysSurvivesResume:!0,toolPolicy:{Bash:"allow",Write:"allow",Edit:"allow",WebFetch:"allow",spawn_worker:"allow"},theme:"light",textSize:"default",density:"comfortable",showTimestamps:!0,notifyNeedsYou:!0,notifyDone:!0,notifyBudget:!0,sound:!1,gitBranchPerMission:!0,projectsRoot:"~/Projects",missionDir:".foreman",showHidden:!1},wb=[{value:"allow",label:"Allow"},{value:"ask",label:"Ask"},{value:"deny",label:"Deny"}],zb=["Bash","Write","Edit","WebFetch","spawn_worker"];function Cb({instances:i=[],ollama:c,codex:u}){const o=[...i.map(d=>({icon:"orchestration",name:"Claude Code",detail:d.configDir,note:d.hasStoredLogin?"signed in":"no stored login"})),...c?[{icon:"model",name:"Ollama",detail:c.host,note:`${c.models.length} model${c.models.length===1?"":"s"}`}]:[],...u?[{icon:"provider",name:"Codex",detail:u.home,note:u.signedIn?"signed in":"not signed in"}]:[]];return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)"},children:[l.jsxs("div",{style:{fontSize:"var(--fs-sm)",color:"var(--ink-1)",lineHeight:"var(--lh-prose)"},children:["A provider is chosen per project — open one and its tab appears beside",l.jsx("b",{style:{color:"var(--ink-0)"},children:" Global"})," above. These are what this machine can offer."]}),o.length===0&&l.jsx(Qe,{children:"Nothing detected. An Anthropic API key or any OpenAI-compatible endpoint still works."}),o.map((d,h)=>l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"var(--sp-2) var(--sp-3)",background:"var(--bg-inset)",border:"1px solid var(--line)",borderRadius:"var(--r-sm)"},children:[l.jsx(ie,{name:d.icon,size:14,color:"var(--ink-2)"}),l.jsx("span",{style:{fontSize:"var(--fs-sm)",fontWeight:"var(--fw-medium)"},children:d.name}),l.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.detail}),l.jsx("span",{style:{marginLeft:"auto",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:d.note})]},h))]})}function Tb({global:i,project:c,projectName:u,models:o,modelsLoading:d,modelsNote:h,provider:m,providerInstances:y,providerOllama:x,providerCodex:p,providerHasKey:S,providerKeyBusy:b,providerKeyError:k,onStoreProviderKey:w,onClearProviderKey:_,notify:X,scope:M,onScope:z,section:R,onSection:N,onSave:Z,onClose:re,onUnlink:B,style:L}){const[P,G]=g.useState(M??"global"),[ce,te]=g.useState(R??"models"),ee=z?M:P,xe=z??G,se=N?R:ce,me=N??te,[j,q]=g.useState({...tu,...i}),[O,ue]=g.useState({...c}),[he,T]=g.useState(m??null),Q=JSON.stringify(he)!==JSON.stringify(m??null),A=JSON.stringify(j)!==JSON.stringify({...tu,...i})||JSON.stringify(O)!==JSON.stringify({...c})||Q,F=ee==="project",ne=ae=>F&&ae in O?O[ae]:j[ae],oe=(ae,Ke)=>F?ue(Ae=>({...Ae,[ae]:Ke})):q(Ae=>({...Ae,[ae]:Ke})),je=ae=>F&&ae in O,Ue=ae=>ue(Ke=>{const Ae={...Ke};return delete Ae[ae],Ae}),ge=(ae,Ke,Ae,wt)=>l.jsx(fr,{label:Ke,hint:Ae,overridden:je(ae),inherits:F&&!je(ae),onReset:()=>Ue(ae),children:wt}),W={models:l.jsxs(l.Fragment,{children:[ge("directorModel","Director","Plans, delegates, verifies. Opus by default; Fable for long-horizon work.",l.jsx($t,{align:"right",allowDefault:!1,models:o,loading:d,note:h,value:ne("directorModel"),onChange:(ae,Ke)=>{oe("directorModel",ae),oe("directorProviderId",Ke?.providerId)}})),ge("workerModel","Workers","Implement scoped tasks. Cheaper models cut cost sharply.",l.jsx($t,{align:"right",allowDefault:!1,models:o,loading:d,note:h,value:ne("workerModel"),onChange:(ae,Ke)=>{oe("workerModel",ae),oe("workerProviderId",Ke?.providerId)}})),ge("plannerModel","Planner","Talks the next mission through with you and reads the project. Conversation, not deep reasoning; Sonnet by default.",l.jsx($t,{align:"right",allowDefault:!1,models:o,loading:d,note:h,value:ne("plannerModel"),onChange:ae=>oe("plannerModel",ae)})),!F&&ge("fleetPlannerModel","Fleet planner","The front desk on your phone: knows every project, opens planning, proposes, steers. Fast tool calls matter more than depth; follows the planner when unset.",l.jsx($t,{align:"right",allowDefault:!1,models:o,loading:d,note:h,value:ne("fleetPlannerModel")||ne("plannerModel"),onChange:ae=>oe("fleetPlannerModel",ae)}))]}),budget:l.jsxs(l.Fragment,{children:[ge("budgetCap","Default cap per run","The composer starts here; you can change it per mission.",l.jsx(Be,{type:"number",prefix:"$",min:0,step:1,width:110,value:ne("budgetCap"),onChange:ae=>oe("budgetCap",ae)})),ge("budgetWarnAt","Warn at","Meter turns amber, the director is told to start verifying, and, if enabled, you get a notification. Leave room: the wind-down turn has to pay for verification and the report.",l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[l.jsx(Be,{type:"number",min:10,max:100,step:5,width:80,value:ne("budgetWarnAt"),onChange:ae=>oe("budgetWarnAt",ae)}),l.jsx("span",{style:{color:"var(--ink-2)"},children:"%"})]})),ge("budgetHardStop","Hard stop at cap","Off: the run pauses and asks instead of stopping.",l.jsx(xt,{checked:ne("budgetHardStop"),onChange:ae=>oe("budgetHardStop",ae)})),ge("scheduledMonthlyCapUsd","Scheduled spend per month","All this project’s scheduled runs together, per calendar month. Foreman pauses a schedule before the run that would go past this, rather than stopping it halfway; only you can resume it, from the project view.",l.jsx(Be,{type:"number",prefix:"$",min:0,step:5,width:110,value:ne("scheduledMonthlyCapUsd"),onChange:ae=>oe("scheduledMonthlyCapUsd",ae)}))]}),approvals:l.jsxs(l.Fragment,{children:[ge("autoAllowReadOnly","Auto-allow read-only tools","Read, Grep, Glob, LS never prompt.",l.jsx(xt,{checked:ne("autoAllowReadOnly"),onChange:ae=>oe("autoAllowReadOnly",ae)})),ge("alwaysSurvivesResume","“Always (run)” survives resume","Grants made during a run carry into a resumed run.",l.jsx(xt,{checked:ne("alwaysSurvivesResume"),onChange:ae=>oe("alwaysSurvivesResume",ae)})),l.jsx(fr,{label:"Guarded tools",hint:"Policy per tool. “Ask” escalates to an approval card; writes outside the project folder always ask.",overridden:je("toolPolicy"),inherits:F&&!je("toolPolicy"),onReset:()=>Ue("toolPolicy"),stacked:!0,children:l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:zb.map(ae=>l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[l.jsx(ie,{name:ae,size:14,color:"var(--ink-2)"}),l.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"var(--fs-sm)",flex:1},children:ae}),l.jsx(sn,{size:"sm",tabs:wb,value:ne("toolPolicy")[ae]||"ask",onChange:Ke=>oe("toolPolicy",{...ne("toolPolicy"),[ae]:Ke})})]},ae))})})]}),appearance:l.jsxs(l.Fragment,{children:[ge("theme","Theme",null,l.jsx(sn,{size:"sm",value:ne("theme"),onChange:ae=>oe("theme",ae),tabs:[{value:"system",label:"System"},{value:"dark",label:"Dark",icon:"moon"},{value:"light",label:"Light",icon:"sun"}]})),ge("textSize","Text size","Scales the whole interface. Anything but Default overrides your browser’s own font size.",l.jsx(sn,{size:"sm",value:ne("textSize"),onChange:ae=>oe("textSize",ae),tabs:[{value:"small",label:"Small"},{value:"default",label:"Default"},{value:"large",label:"Large"},{value:"larger",label:"Larger"}]})),ge("density","Density","Compact tightens transcript rows and rail padding.",l.jsx(sn,{size:"sm",value:ne("density"),onChange:ae=>oe("density",ae),tabs:[{value:"comfortable",label:"Comfortable"},{value:"compact",label:"Compact"}]})),ge("showTimestamps","Timestamps in transcript",null,l.jsx(xt,{checked:ne("showTimestamps"),onChange:ae=>oe("showTimestamps",ae)}))]}),notifications:l.jsxs(l.Fragment,{children:[ge("notifyNeedsYou","Needs you","An approval or question is waiting.",l.jsx(xt,{checked:ne("notifyNeedsYou"),onChange:ae=>oe("notifyNeedsYou",ae)})),ge("notifyDone","Run finished","Done, errored or interrupted.",l.jsx(xt,{checked:ne("notifyDone"),onChange:ae=>oe("notifyDone",ae)})),ge("notifyBudget","Budget warning","When spend crosses the warn threshold.",l.jsx(xt,{checked:ne("notifyBudget"),onChange:ae=>oe("notifyBudget",ae)})),ge("sound","Sound",null,l.jsx(xt,{checked:ne("sound"),onChange:ae=>oe("sound",ae)})),!F&&X&&l.jsx(kb,{...X})]}),provider:F?l.jsx(fr,{label:"Provider",hint:"Which engine runs this project's agents, who pays, and where requests go. Clearing it returns to the server default.",stacked:!0,children:l.jsx(Sb,{value:he,onChange:T,instances:y,ollama:x,hasKey:S,keyBusy:b,keyError:k,onStoreKey:w,onClearKey:_})}):l.jsx(Cb,{instances:y,ollama:x,codex:p}),projects:l.jsxs(l.Fragment,{children:[!F&&ge("projectsRoot","Projects root","Where the folder picker opens.",l.jsx(Be,{mono:!0,width:260,value:ne("projectsRoot"),onChange:ae=>oe("projectsRoot",ae)})),ge("missionDir","Mission folder","Relative to the project. Holds MISSION.md and run history.",l.jsx(Be,{mono:!0,width:160,value:ne("missionDir"),onChange:ae=>oe("missionDir",ae)})),ge("allowWorktreeParent","Worktree parent","A mission in a git worktree may use the repository it was made from without asking. Sibling worktrees stay closed.",l.jsx(xt,{checked:ne("allowWorktreeParent")!==!1,onChange:ae=>oe("allowWorktreeParent",ae)})),ge("gitBranchPerMission","Each mission on its own branch","In a git repository: Foreman creates foreman/<mission> from what is checked out, commits the work on it at the end, and never merges or pushes. Off: missions edit the current branch.",l.jsx(xt,{checked:ne("gitBranchPerMission")!==!1,onChange:ae=>oe("gitBranchPerMission",ae)})),!F&&ge("showHidden","Show hidden folders in picker",null,l.jsx(xt,{checked:ne("showHidden"),onChange:ae=>oe("showHidden",ae)})),F&&l.jsx(fr,{label:"Unlink this project",hint:"Removes it from the fleet. Files on disk are untouched.",danger:!0,children:l.jsx(le,{variant:"danger",size:"sm",icon:"unlink",onClick:B,children:"Unlink"})})]})},ze=Kc.find(ae=>ae.id===se)||Kc[0];return l.jsxs(Nl,{width:"51.25rem",onClose:re,dismissible:!1,style:{maxHeight:"82vh",height:"37.5rem",...L},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)",padding:"var(--sp-2) var(--sp-3)",borderBottom:"1px solid var(--line)"},children:[l.jsx("span",{style:{fontSize:"var(--fs-lg)",fontWeight:"var(--fw-semibold)"},children:"Settings"}),l.jsx(sn,{size:"sm",value:ee,onChange:xe,tabs:[...u?[{value:"project",label:u,icon:"folder"}]:[],{value:"global",label:"Global"}]}),l.jsx(Ya,{icon:"close",label:"Close",onClick:re,style:{marginLeft:"auto"}})]}),l.jsxs("div",{style:{flex:1,minHeight:0,display:"grid",gridTemplateColumns:"11.25rem 1fr"},children:[l.jsx("nav",{style:{background:"var(--bg-inset)",borderRight:"1px solid var(--line)",padding:"var(--sp-2)",display:"flex",flexDirection:"column",gap:2},children:Kc.map(ae=>l.jsx(_b,{s:ae,selected:ae.id===se,dot:F&&(Eb(ae.id,O)||ae.id==="provider"&&!!he),onClick:()=>me(ae.id)},ae.id))}),l.jsxs("div",{style:{minHeight:0,overflowY:"auto",padding:"var(--sp-3) var(--sp-5)"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--sp-2)",marginBottom:"var(--sp-2)"},children:[l.jsx("span",{style:{fontSize:"var(--fs-lg)",fontWeight:"var(--fw-semibold)"},children:ze.label}),F&&l.jsxs("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:["Overrides for ",l.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:u}),". Rows without a change inherit global."]})]}),W[ze.id]]})]}),l.jsxs(Ul,{children:[l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:A?"var(--status-warning)":"var(--ink-2)"},children:A?"Unsaved changes":"Nothing to save"}),l.jsxs("span",{style:{marginLeft:"auto",display:"flex",gap:"var(--sp-2)"},children:[l.jsx(le,{onClick:re,children:"Cancel"}),l.jsx(le,{variant:"primary",disabled:!A,onClick:()=>Z?.({global:j,project:O,provider:Q?he:void 0}),children:"Save"})]})]})]})}const Mb={models:["directorModel","workerModel","plannerModel","fleetPlannerModel","directorProviderId","workerProviderId"],budget:["budgetCap","budgetWarnAt","budgetHardStop","scheduledMonthlyCapUsd"],approvals:["autoAllowReadOnly","alwaysSurvivesResume","toolPolicy"],appearance:["theme","density","showTimestamps"],notifications:["notifyNeedsYou","notifyDone","notifyBudget","sound"],projects:["missionDir","gitBranchPerMission"]};function Eb(i,c){return(Mb[i]||[]).some(u=>u in c)}function _b({s:i,selected:c,dot:u,onClick:o}){const[d,h]=g.useState(!1);return l.jsxs("button",{type:"button",onClick:o,"aria-current":c||void 0,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:"var(--r-sm)",border:"none",textAlign:"left",cursor:"pointer",font:"inherit",color:c?"var(--ink-0)":"var(--ink-1)",fontWeight:c?"var(--fw-semibold)":"var(--fw-regular)",background:c?"var(--bg-card)":d?"var(--bg-hover)":"transparent",boxShadow:c?"inset 0 0 0 1px var(--line-strong)":"none"},children:[l.jsx(ie,{name:i.icon,size:14,color:c?"var(--brand)":"var(--ink-2)"}),l.jsx("span",{style:{flex:1},children:i.label}),u&&l.jsx("span",{title:"Has project overrides",style:{width:6,height:6,borderRadius:"var(--r-pill)",background:"var(--brand)"}})]})}function fr({label:i,hint:c,children:u,overridden:o,inherits:d,onReset:h,stacked:m,danger:y}){return l.jsxs("div",{style:{display:"grid",gridTemplateColumns:m?"1fr":"1fr auto",gap:m?10:"var(--sp-4)",alignItems:"center",padding:"var(--sp-3) 0",borderBottom:"1px solid var(--line)"},children:[l.jsxs("div",{style:{minWidth:0},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:y?"var(--status-critical)":"var(--ink-0)"},children:[l.jsx("span",{children:i}),d&&l.jsx(Op,{children:"global"}),o&&l.jsxs(l.Fragment,{children:[l.jsx(Op,{brand:!0,children:"override"}),l.jsx("button",{type:"button",onClick:h,style:{background:"none",border:0,padding:0,font:"inherit",fontSize:"var(--fs-xs)",color:"var(--ink-2)",cursor:"pointer",textDecoration:"underline",textUnderlineOffset:2},children:"reset to global"})]})]}),c&&l.jsx("div",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",marginTop:2},children:c})]}),l.jsx("div",{style:{display:"flex",justifyContent:m?"stretch":"flex-end",minWidth:0},children:u})]})}function Op({children:i,brand:c}){return l.jsx("span",{style:{fontSize:"var(--fs-xs)",letterSpacing:"0.06em",textTransform:"uppercase",padding:"1px 6px",borderRadius:"var(--r-pill)",background:c?"var(--brand-wash-strong)":"var(--bg-inset)",color:c?"var(--brand)":"var(--ink-2)",border:`1px solid ${c?"transparent":"var(--line)"}`},children:i})}function Np({agent:i,status:c="running",task:u,selected:o,indent:d,last:h,onSelect:m,style:y}){const[x,p]=g.useState(!1);return l.jsxs("div",{style:{position:"relative",marginLeft:d?14:0},children:[d&&l.jsx("span",{"aria-hidden":!0,style:{position:"absolute",left:-8,top:0,bottom:h?"50%":0,borderLeft:"1px solid var(--line-strong)"}}),d&&l.jsx("span",{"aria-hidden":!0,style:{position:"absolute",left:-8,top:"50%",width:8,borderTop:"1px solid var(--line-strong)"}}),l.jsxs("div",{role:"button",title:u,onClick:()=>m?.(i),onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"6px 8px",borderRadius:"var(--r-sm)",cursor:"pointer",background:o?"var(--bg-card)":x?"var(--bg-hover)":"transparent",border:o?"1px solid var(--line-strong)":"1px solid transparent",transition:"background var(--dur-fast) var(--ease)",...y},children:[l.jsx(mn,{agent:i}),l.jsx("span",{style:{flex:1,minWidth:0,fontSize:"var(--fs-md)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i}),l.jsx(ya,{status:c})]})]})}function Db({agents:i=[],filter:c,onFilter:u,sessionId:o,details:d,style:h}){const m=i.find(p=>p.id==="director"),y=i.filter(p=>p.id!=="director"),x={margin:"0 0 6px 0",fontSize:"var(--fs-xs)",color:"var(--ink-1)",lineHeight:"var(--lh)",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"};return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)",...h},children:[l.jsxs("section",{style:{minWidth:0},children:[l.jsx(pn,{children:"Crew"}),i.length===0&&l.jsx(Qe,{children:"No agents yet."}),m&&l.jsx(Np,{agent:"director",status:m.status,selected:c==="director",onSelect:u}),y.map((p,S)=>l.jsxs(vn.Fragment,{children:[l.jsx(Np,{agent:p.id,status:p.status,task:p.task,indent:!0,last:S===y.length-1,selected:c===p.id,onSelect:u}),p.task&&l.jsx("div",{title:p.task,style:{...x,marginLeft:34},children:p.task})]},p.id)),c&&l.jsxs("div",{style:{marginTop:4,fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:["Transcript shows only ",l.jsx("b",{style:{color:"var(--ink-1)"},children:c})," — click again to clear."]})]}),l.jsxs("section",{style:{minWidth:0},children:[l.jsx(pn,{children:"Run"}),d??l.jsx(Qe,{children:"No run details."}),o&&l.jsxs("div",{style:{marginTop:6,fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontFamily:"var(--font-mono)"},children:["director session ",String(o).slice(0,8)]})]})]})}function Ab({director:i,worker:c,budget:u,spent:o,models:d,loading:h,note:m,busy:y,onResume:x,style:p}){const[S,b]=g.useState(!1),[k,w]=g.useState({id:i||"",providerId:void 0}),[_,X]=g.useState({id:c||"",providerId:void 0}),[M,z]=g.useState(u??0),R=g.useRef(null);g.useEffect(()=>{w({id:i||"",providerId:void 0}),X({id:c||"",providerId:void 0}),z(u??0)},[i,c,u,S]),g.useEffect(()=>{if(!S)return;const P=ce=>{R.current&&!R.current.contains(ce.target)&&b(!1)},G=ce=>{ce.key==="Escape"&&b(!1)};return document.addEventListener("mousedown",P),document.addEventListener("keydown",G),()=>{document.removeEventListener("mousedown",P),document.removeEventListener("keydown",G)}},[S]);const N=typeof u=="number"&&Number.isFinite(M)&&M>0&&Math.abs(M-u)>=.005,Z=k.id&&k.id!==i||_.id&&_.id!==c||N,re=()=>{x?.({...k.id&&k.id!==i?{directorModel:k.id,directorProviderId:k.providerId}:{},..._.id&&_.id!==c?{workerModel:_.id,workerProviderId:_.providerId}:{},...N?{budgetUsd:Math.round(M*100)/100}:{}}),b(!1)},B=P=>z(Math.round((M+P)*100)/100),L={fontSize:"var(--fs-xs)",color:"var(--ink-2)",textTransform:"uppercase",letterSpacing:"var(--ls-caps)",marginBottom:4};return l.jsxs("div",{ref:R,style:{position:"relative",display:"inline-flex",...p},children:[l.jsx(le,{variant:"good",icon:"resume",disabled:y,title:"Restore the director's session and continue this mission",onClick:()=>x?.({}),style:{borderTopRightRadius:0,borderBottomRightRadius:0},children:y?"Resuming…":"Resume"}),l.jsx(le,{variant:"good",disabled:y,"aria-label":"Resume on other models",title:"Resume on other models…",onClick:()=>b(!S),style:{borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeft:"1px solid rgba(255,255,255,0.35)",paddingLeft:6,paddingRight:6},children:l.jsx(ie,{name:"chevronDown",size:14})}),S&&l.jsxs("div",{role:"dialog","aria-label":"Resume on other models",style:{position:"absolute",top:"calc(100% + 6px)",right:0,zIndex:50,width:340,background:"var(--bg-card)",border:"1px solid var(--line-strong)",borderRadius:"var(--r-md)",boxShadow:"0 12px 32px rgba(0,0,0,0.25)",padding:"var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-3)"},children:[l.jsx("div",{style:{fontSize:"var(--fs-sm)",color:"var(--ink-1)",lineHeight:"var(--lh)"},children:"Same mission, other terms. A new director starts a fresh session and reads the mission doc; workers change for the next spawns; a new cap applies from the first turn."}),typeof u=="number"&&l.jsxs("div",{children:[l.jsx("div",{style:L,children:"Budget cap"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[l.jsx("span",{style:{color:"var(--ink-2)"},children:"$"}),l.jsx("input",{type:"number",min:"0.5",step:"0.5",value:M,onChange:P=>z(Number(P.target.value)),style:{width:72,font:"inherit",fontFamily:"var(--font-mono)",padding:"4px 6px",border:"1px solid var(--line-strong)",borderRadius:"var(--r-sm)",background:"var(--bg-inset)",color:"var(--ink-0)"}}),l.jsx(le,{size:"sm",onClick:()=>B(5),children:"+$5"}),l.jsx(le,{size:"sm",onClick:()=>B(10),children:"+$10"}),l.jsx(le,{size:"sm",onClick:()=>z(Math.round(u*2*100)/100),children:"×2"}),typeof o=="number"&&l.jsxs("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontVariantNumeric:"tabular-nums"},children:["$",o.toFixed(2)," spent of $",u.toFixed(2)]})]})]}),l.jsxs("div",{children:[l.jsx("div",{style:L,children:"Director"}),l.jsx($t,{block:!0,allowDefault:!1,models:d,loading:h,note:m,value:k.id,onChange:(P,G)=>w({id:P,providerId:G?.providerId})})]}),l.jsxs("div",{children:[l.jsx("div",{style:L,children:"Workers"}),l.jsx($t,{block:!0,allowDefault:!1,models:d,loading:h,note:m,value:_.id,onChange:(P,G)=>X({id:P,providerId:G?.providerId})})]}),l.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"var(--sp-2)"},children:[l.jsx(le,{variant:"ghost",size:"sm",onClick:()=>b(!1),children:"Cancel"}),l.jsx(le,{variant:"good",size:"sm",icon:"resume",disabled:y||!Z,onClick:re,title:Z?"Resume on these terms":"Change a model or the cap first — or use Resume as is",children:"Resume"})]})]})]})}function Rb(i,c){const u=Gp(i.provider);return!i.provider||!u?c:i.provider.kind==="claude-code"?i.provider.ownLogin?`${u} (this project's own login)`:u:`${i.provider.kind} · ${u}`}function Ob(i){const c=`(min-width: ${i}px)`,[u,o]=g.useState(()=>typeof window<"u"&&window.matchMedia(c).matches);return g.useEffect(()=>{const d=window.matchMedia(c),h=()=>o(d.matches);return h(),d.addEventListener("change",h),()=>d.removeEventListener("change",h)},[c]),u}const Nb=1100;function Ub(i){const c=i.agents.filter(y=>y.status==="running"),u=c.filter(y=>y.id!=="director").length,o=c.length===0?"":[c.some(y=>y.id==="director")?"director":null,u?`${u} worker${u===1?"":"s"}`:null].filter(Boolean).join(" · ");let d=null;for(let y=i.entries.length-1;y>=0&&y>=i.entries.length-40;y--){const x=i.entries[y],p=x.kind==="system"&&x.title.startsWith("progress"),S=x.kind==="text"&&x.agent==="director";if(p||S){d=x;break}}if(!d){const y=c.find(x=>x.id!=="director"&&x.task);return y?{line:`${y.id}: ${y.task}`,agent:y.id,crew:o}:o?{line:"Crew is starting up",crew:o}:null}const h=d.body.split(`
|
|
66
|
+
`).find(y=>y.trim())??"";return{line:`${d.agent}: ${h.replace(/[*_`#>]/g,"").trim().slice(0,160)}`,agent:d.agent,crew:o}}function La({label:i,open:c,onToggle:u,children:o}){return l.jsxs("div",{style:{border:"1px solid var(--line)",borderRadius:"var(--r-sm)",background:"var(--bg-panel)"},children:[l.jsxs("button",{type:"button",onClick:u,style:{display:"flex",alignItems:"center",gap:6,width:"100%",padding:"6px 10px",background:"none",border:"none",cursor:"pointer",font:"inherit",textAlign:"left",fontSize:"var(--fs-xs)",color:"var(--ink-2)",textTransform:"uppercase",letterSpacing:"var(--ls-caps)"},children:[l.jsx(ie,{name:c?"chevronDown":"chevronRight",size:12}),i]}),c&&l.jsx("div",{style:{padding:"0 10px 10px"},children:o})]})}const hv={width:"100%",maxWidth:"var(--spine-max)",margin:"0 auto",display:"flex",flexDirection:"column",gap:"var(--sp-2)",boxSizing:"border-box"},Up="foreman.transcriptOrder",Hp="foreman.timeline",hr=i=>new Date(i).toLocaleDateString(void 0,{month:"short",day:"numeric"}),Bp="foreman.railWidth",Zc=280,$p=340;function Hb(){const[i,c]=g.useState(()=>{try{return localStorage.getItem(Up)==="oldest"?"oldest":"newest"}catch{return"newest"}});return[i,u=>{c(u);try{localStorage.setItem(Up,u)}catch{}}]}function qp(i,c){return c==="newest"?0:i.scrollHeight}function Bb({run:i,filter:c,jump:u,order:o,header:d}){const h=g.useRef(null),m=g.useRef(!0),[y,x]=g.useState(null),p=c?i.entries.filter(b=>b.agent===c):i.entries,S=o==="newest"?[...p].reverse():p;return g.useEffect(()=>{const b=h.current;b&&m.current&&(b.scrollTop=qp(b,o))},[S.length,o]),g.useEffect(()=>{m.current=!0;const b=h.current;b&&(b.scrollTop=qp(b,o))},[o]),g.useEffect(()=>{if(!u)return;m.current=!1;const b=requestAnimationFrame(()=>{document.getElementById(`entry-${u.id}`)?.scrollIntoView({behavior:"smooth",block:"center"}),x(u.id)}),k=setTimeout(()=>x(null),1600);return()=>{cancelAnimationFrame(b),clearTimeout(k)}},[u]),l.jsx("div",{ref:h,onScroll:b=>{const k=b.currentTarget;m.current=o==="newest"?k.scrollTop<60:k.scrollHeight-k.scrollTop-k.clientHeight<60},style:{overflowY:"auto",padding:"var(--sp-3)",minHeight:0,flex:1,display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:l.jsxs("div",{style:hv,children:[d,S.length===0&&l.jsx(Qe,{children:"Transcript will appear here."}),S.map(b=>l.jsx("div",{id:`entry-${b.id}`,style:{scrollMarginTop:8,borderRadius:"var(--r-sm)",outline:y===b.id?"2px solid var(--brand)":"none",transition:"outline-color var(--dur-fast) var(--ease)"},children:l.jsx(su,{agent:b.agent,title:b.title,dense:!0,kind:b.kind,body:b.body,ts:b.ts,to:b.to,timing:b.timing})},b.id))]})})}function $b(i){const[c,u]=g.useState({text:"",loaded:!1});return g.useEffect(()=>{let o=!1;const d=()=>Se.memory(i).then(async m=>{if(o||!m.ok)return;const y=await m.json();u({text:y.text??"",updatedAt:y.updatedAt,loaded:!0})}).catch(()=>{});d();const h=Ol((m,y)=>{m==="memory_updated"&&y.projectId===i&&d()});return()=>{o=!0,h()}},[i]),c}function qb(i,c){const[u,o]=g.useState([]),d=vn.useCallback(()=>{if(!i){o([]);return}Se.runServices(i).then(async h=>{if(!h.ok)return;const m=await h.json();o(m.services??[])}).catch(()=>{})},[i]);return g.useEffect(d,[d,c]),{list:u,refresh:d}}function Lb({runId:i,services:c,onDone:u}){const[o,d]=g.useState(null),[h,m]=g.useState(""),y=c.filter(p=>p.listening);if(!y.length)return null;const x=async p=>{d(p),m("");const S=await Se.stopService(i,p).finally(()=>d(null));S.ok||m((await S.json().catch(()=>({error:"could not stop it"}))).error),u()};return l.jsxs(Fe,{tone:"caution",children:["This run left ",y.length===1?"a server":`${y.length} servers`," running:"," ",y.map((p,S)=>l.jsxs("span",{children:[S>0?", ":"",l.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:p.port})," (",p.label,")",p.ours?l.jsx(le,{variant:"ghost",size:"sm",disabled:o===p.port,style:{marginLeft:4},onClick:()=>{x(p.port)},children:o===p.port?"Stopping…":"Stop"}):l.jsx("span",{style:{color:"var(--ink-2)"},children:" — held by another process now, left alone"})]},p.port)),h&&l.jsx("div",{style:{marginTop:4,color:"var(--ink-2)"},children:h})]})}function Yb({memory:i}){const c=i.updatedAt?new Date(i.updatedAt).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):null;return l.jsxs("section",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--sp-2)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",textTransform:"uppercase",letterSpacing:"var(--ls-caps)"},children:["Memory",c&&l.jsx("span",{style:{textTransform:"none",letterSpacing:0,marginLeft:"auto"},children:c})]}),i.loaded&&!i.text.trim()?l.jsxs(Qe,{children:["Nothing yet. The director writes ",l.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:".foreman/MEMORY.md"})," at the end of a mission: how to run and test the project, ports and paths, conventions, traps. Every later crew and the planner read it first."]}):i.text.trim()?l.jsx("div",{title:"The project's notes for the next crew — .foreman/MEMORY.md. Edit it with any editor.",style:{padding:"var(--sp-2) var(--sp-3)",background:"var(--bg-card)",border:"1px solid var(--line)",borderRadius:"var(--r-sm)",fontSize:"var(--fs-sm)",maxHeight:"40vh",overflowY:"auto"},children:l.jsx($i,{text:i.text})}):null]})}function Gb({runId:i,onClose:c,onDone:u}){const[o,d]=g.useState(null),[h,m]=g.useState(""),[y,x]=g.useState(""),[p,S]=g.useState(""),[b,k]=g.useState(!1),[w,_]=g.useState(null);g.useEffect(()=>{let z=!1;return Se.prDraft(i).then(async R=>{const N=await R.json().catch(()=>({}));if(!z){if(!R.ok){m(N.error??`HTTP ${R.status}`);return}d(N),x(N.title),S(N.body)}}).catch(()=>{z||m("Could not reach the server.")}),()=>{z=!0}},[i]);const X=async()=>{k(!0),m("");try{const z=await Se.openPr(i,y,p),R=await z.json().catch(()=>({}));if(!z.ok){m(R.error??`HTTP ${z.status}`);return}_(R),u(R.url)}finally{k(!1)}},M=o?.gh.present&&o.gh.authed&&/github\.com/.test(o.remote);return l.jsxs(Nl,{width:640,onClose:b?void 0:c,children:[l.jsxs("div",{style:{padding:"var(--sp-3)",borderBottom:"1px solid var(--line)",display:"flex",flexDirection:"column",gap:4},children:[l.jsx("span",{style:{fontWeight:"var(--fw-semibold)"},children:"Open a pull request"}),o&&l.jsxs("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontFamily:"var(--font-mono)"},children:[o.branch," → ",o.base,o.commits!==null?` · ${o.commits} commit${o.commits===1?"":"s"}`:""," · ",o.remote]})]}),l.jsxs("div",{style:{padding:"var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-3)",overflowY:"auto",minHeight:0},children:[!o&&!h&&l.jsx(Qe,{children:"Reading the branch…"}),o&&!w&&l.jsxs(l.Fragment,{children:[o.pr&&l.jsxs(Fe,{tone:"readonly",inline:!0,children:["A pull request already exists for this branch: ",l.jsx("a",{href:o.pr,target:"_blank",rel:"noopener noreferrer",children:o.pr})]}),o.baseFellBack&&l.jsxs(Fe,{tone:"caution",inline:!0,children:["This mission was branched from ",l.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:o.branchedFrom}),", which is not on the remote — a previous mission's branch, most likely. The request targets"," ",l.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:o.base})," instead, so it carries that mission's commits too until its own branch is merged."]}),!o.onBranch&&l.jsxs(Fe,{tone:"caution",inline:!0,children:["The folder is currently on another branch. The push sends ",o.branch," as it is in git, which is fine; just know what you are looking at locally."]}),o.dirty&&o.onBranch&&l.jsx(Fe,{tone:"caution",inline:!0,children:"There are uncommitted changes in the folder. They are not part of this pull request."}),l.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:6,fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:["Title",l.jsx(Be,{value:y,onChange:x})]}),l.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:6,fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:["Body",l.jsx(ru,{size:"mission",value:p,onChange:S})]}),l.jsxs("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:["Create pushes ",l.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:o.branch})," to origin as you, with your own git credentials",M?l.jsxs(l.Fragment,{children:[", then opens the pull request with ",l.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:"gh"}),"."]}):l.jsxs(l.Fragment,{children:[", then gives you the link to finish the pull request in the browser",o.gh.present?"":" (gh is not installed)","."]})," ","Nothing is merged."]})]}),w&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:[l.jsx("span",{children:w.method==="gh"?"Pull request opened.":"Branch pushed. Finish the pull request in the browser:"}),w.url&&l.jsx("a",{href:w.url,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--font-mono)",wordBreak:"break-all"},children:w.url}),w.note&&l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:w.note})]}),h&&l.jsx(Fe,{tone:"error",inline:!0,children:h})]}),l.jsxs(Ul,{children:[l.jsx("span",{style:{flex:1}}),l.jsx(le,{onClick:c,disabled:b,children:w?"Close":"Cancel"}),o&&!w&&l.jsx(le,{variant:"primary",disabled:b||!y.trim(),onClick:()=>{X()},children:b?"Pushing…":M?"Push & create pull request":"Push & get the link"})]})]})}function Wb({chat:i,folder:c,starting:u,error:o,errorAction:d,models:h,modelsLoading:m,modelsNote:y,modelsInheritNote:x,onStart:p,onCompose:S,hasRuns:b,projectId:k,onSettings:w,recent:_=[],runsOn:X,onOpenRun:M,onForkRun:z,forking:R=!1}){const[N,Z]=g.useState(""),[re,B]=g.useState(""),[L,P]=g.useState(0),[G,ce]=g.useState(!1),te=j=>{B(j),P(q=>q+1)},ee=async(j,q=[])=>{Z("");try{await i.send(await Kp(k,j,q))}catch(O){Z(O.message)}},xe=g.useRef(null),se=g.useRef(!0);return g.useEffect(()=>{const j=xe.current;j&&se.current&&(j.scrollTop=j.scrollHeight)},[i.entries.length,i.proposal,i.thinking]),i.entries.length===0&&!i.thinking&&!i.question&&!i.proposal?l.jsx("div",{style:{flex:1,minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column"},children:l.jsxs("div",{style:{margin:"auto",width:"100%",maxWidth:"var(--composer-max)",padding:"var(--sp-4) var(--sp-3)",boxSizing:"border-box",display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:[l.jsxs("div",{style:{textAlign:"center",display:"flex",flexDirection:"column",gap:"var(--sp-1)"},children:[l.jsx("span",{style:{fontSize:"var(--fs-lg)",fontWeight:"var(--fw-semibold)"},children:_.length?"Pick up where you left off, or start something new":"What should this project do next?"}),l.jsx("span",{style:{fontSize:"var(--fs-sm)",color:"var(--ink-2)"},children:_.length?"Open a run to see what it built, plan the next step from it, or describe something new below.":"Describe it, paste a spec or a screenshot, or pick a starter and edit it before sending."})]}),_.length>0&&l.jsxs("div",{style:{border:"1px solid var(--line)",borderRadius:"var(--r-md)",background:"var(--bg-card)",overflow:"hidden"},children:[(G?_:_.slice(0,4)).map((j,q)=>{const O=j.status!=="running",ue=new Date(j.createdAt).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});return l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",alignItems:"center",gap:"var(--sp-3)",padding:"var(--sp-2) var(--sp-3)",borderTop:q>0?"1px solid var(--line)":"none"},children:[l.jsxs("button",{type:"button",onClick:()=>M?.(j.id),title:"Open this run",style:{minWidth:0,textAlign:"left",background:"none",border:0,padding:0,font:"inherit",color:"inherit",cursor:"pointer",display:"flex",flexDirection:"column",gap:2},children:[l.jsx("span",{style:{fontSize:"var(--fs-sm)",color:"var(--ink-0)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:j.title||j.mission.split(`
|
|
67
|
+
`)[0]}),l.jsxs("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",display:"inline-flex",alignItems:"center",gap:"var(--sp-2)",fontVariantNumeric:"tabular-nums"},children:[l.jsx(ya,{status:j.status}),l.jsx("span",{children:ue}),ga(j)==="priced"&&l.jsxs("span",{children:["$",j.costUsd.toFixed(2)]})]})]}),l.jsxs("span",{style:{display:"inline-flex",gap:"var(--sp-1)",flex:"0 0 auto"},children:[l.jsx(le,{variant:"ghost",size:"sm",onClick:()=>M?.(j.id),children:"Open"}),O&&l.jsx(le,{size:"sm",icon:"steer",disabled:R||i.thinking,title:"Start a planning conversation seeded with what this run built",onClick:()=>z?.(j.id),children:"Plan the next step"})]})]},j.id)}),_.length>4&&l.jsx("div",{style:{borderTop:"1px solid var(--line)",padding:"4px var(--sp-2)"},children:l.jsx(le,{variant:"ghost",size:"sm",onClick:()=>ce(j=>!j),children:G?"Show the latest four":`Show all ${_.length} runs`})})]}),l.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(auto-fit, minmax(${_.length?150:200}px, 1fr))`,gap:"var(--sp-2)"},children:[..._.length?[]:[{t:"Survey the project",q:"Read this project and tell me what it is, how it is built, and what state it is in."}],{t:"Find risks worth a mission",q:"Audit this project for bugs, security holes and missing tests. Rank what you find and propose the one mission most worth running first."},{t:"Scope a feature",q:"I have a feature in mind. Ask me what you need to know to scope it, then draft the mission."},{t:"Plan a refactor",q:"Where is this codebase hardest to change? Propose one contained refactor with clear DONE WHEN criteria."}].map(j=>l.jsxs("button",{type:"button",onClick:()=>te(j.q),disabled:i.thinking,title:_.length?j.q:void 0,style:{textAlign:"left",padding:_.length?"6px 10px":"8px 10px",background:"var(--bg-card)",border:"1px solid var(--line)",borderRadius:"var(--r-sm)",cursor:"pointer",font:"inherit",color:"inherit",display:"flex",flexDirection:"column",gap:2},children:[l.jsx("span",{style:{fontSize:"var(--fs-sm)",fontWeight:"var(--fw-semibold)",color:"var(--ink-0)"},children:j.t}),!_.length&&l.jsx("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",lineHeight:"var(--lh)"},children:j.q})]},j.t))}),l.jsx(Ic,{value:re,onChange:B,busy:i.thinking,who:i.who,onSend:(j,q)=>{ee(j,q)},onStop:()=>{i.stop()},onChangeModel:w,autoFocus:!0},L),N&&l.jsx(Fe,{tone:"error",inline:!0,children:N}),l.jsxs("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",textAlign:"center"},children:["Planning reads the project and never changes it — a mission does that. Know what you want already? ",l.jsx("b",{style:{color:"var(--ink-1)"},children:"New mission"}),", top right."]}),X&&l.jsx("div",{style:{display:"flex",justifyContent:"center"},children:X})]})}):l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:xe,onScroll:j=>{const q=j.currentTarget;se.current=q.scrollHeight-q.scrollTop-q.clientHeight<60},style:{flex:1,minHeight:0,overflowY:"auto",padding:"var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:l.jsxs("div",{style:hv,children:[i.entries.map((j,q)=>{const O=hr(j.ts),ue=q>0?hr(i.entries[q-1].ts):null;return l.jsxs(vn.Fragment,{children:[O!==ue&&(q>0||O!==hr(Date.now()))&&l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",margin:"4px 0"},children:[l.jsx("span",{style:{flex:1,borderTop:"1px solid var(--line)"}}),l.jsx("span",{children:O===hr(Date.now())?"today":O}),l.jsx("span",{style:{flex:1,borderTop:"1px solid var(--line)"}})]}),l.jsx(su,{agent:j.agent,title:j.title,kind:j.kind,body:j.body,ts:j.ts})]},j.id)}),i.proposal&&l.jsx($1,{mission:i.proposal.mission,doneWhen:i.proposal.doneWhen,budgetUsd:i.proposal.budgetUsd,rationale:i.proposal.rationale,browser:i.proposal.browser,directorModel:i.proposal.directorModel,workerModel:i.proposal.workerModel,directorProviderId:i.proposal.directorProviderId,workerProviderId:i.proposal.workerProviderId,modelRationale:i.proposal.modelRationale,models:h,modelsLoading:m,modelsNote:y,modelsInheritNote:x,busy:u,error:o,errorAction:d,onStart:j=>p(j),onDismiss:i.dismissProposal})]})}),l.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-3) var(--sp-3)",flex:"0 0 auto",width:"100%",maxWidth:"var(--spine-max)",margin:"0 auto",boxSizing:"border-box"},children:[i.question?l.jsx(B1,{questions:i.question.questions,askedAt:i.question.askedAt,who:i.who,onAnswer:j=>{i.answer(i.question.id,j)},onFreeText:j=>{ee(j)}}):l.jsx(Ic,{busy:i.thinking,who:i.who,onSend:(j,q)=>{ee(j,q)},onStop:()=>{i.stop()},onChangeModel:w}),N&&l.jsx(Fe,{tone:"error",inline:!0,style:{marginTop:4},children:N}),(i.costUsd>0||i.entries.length>0)&&l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"4px 2px 0",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:[i.costUsd>0&&l.jsxs("span",{title:"What this conversation has cost so far. Planning is not charged to any mission budget.",style:{fontVariantNumeric:"tabular-nums"},children:["conversation $",i.costUsd.toFixed(3)]}),l.jsx("span",{style:{flex:1}}),i.thinking&&l.jsx(le,{variant:"ghost",size:"sm",icon:"close",title:"Stop the planner and discard the rest of this reply",onClick:()=>{i.stop()},children:"Stop"}),i.entries.length>0&&l.jsx(le,{variant:"ghost",size:"sm",icon:"close",disabled:i.thinking,title:i.thinking?"The planner is replying — clear once it has answered.":"Forget this conversation and start a new one",onClick:()=>{i.clear()},children:i.thinking?"Clear (after this reply)":"Clear conversation"})]})]}),l.jsxs("button",{type:"button",onClick:S,style:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:6,margin:"0 auto var(--sp-3)",padding:"6px 10px",width:"calc(100% - 2 * var(--sp-3))",maxWidth:"calc(var(--spine-max) - 2 * var(--sp-3))",boxSizing:"border-box",background:"none",border:"1px dashed var(--line-strong)",borderRadius:"var(--r-sm)",cursor:"pointer",font:"inherit",fontSize:"var(--fs-xs)",color:"var(--ink-2)",textAlign:"left"},children:[l.jsx(ie,{name:"write",size:12}),"Or skip the talk: describe the mission and start it",l.jsx(ie,{name:"chevronRight",size:12,style:{marginLeft:"auto"}})]})]})}function Xb({r:i,live:c,liveCost:u,liveBasis:o,liveUsage:d,liveTurns:h,onChanged:m}){const[y,x]=g.useState(!1),[p,S]=g.useState(""),b=!!c&&i.status==="running",k=async R=>{x(!0),S("");try{await Se.updateRun(i.id,R),m?.()}catch(N){S(N instanceof Error?N.message:String(N))}finally{x(!1)}},w=o??ga(i),_=d??i.usage??null,X=h??i.turns,M=[["director",i.directorModel||"default"],["workers",i.workerModel||"default"],["budget",w==="priced"?`$${((u??i.costUsd)||0).toFixed(2)} / $${i.budgetUsd.toFixed(2)}`:`${Ga(_?.inputTokens??0)} in · ${Ga(_?.outputTokens??0)} out${typeof X=="number"?` · ${X} turn${X===1?"":"s"}`:""}`+(w==="unpriced"?" · cost not tracked":" · no per-token cost")]],z={color:"var(--ink-1)",fontFamily:"var(--font-mono)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};return l.jsxs("div",{style:{marginTop:8,fontSize:"var(--fs-xs)"},children:[l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",columnGap:10,rowGap:2},children:[M.map(([R,N])=>l.jsxs(vn.Fragment,{children:[l.jsx("span",{style:{color:"var(--ink-2)"},children:R}),l.jsx("span",{style:z,children:N})]},R)),l.jsx("span",{style:{color:"var(--ink-2)"},children:"browser"}),b?l.jsx("button",{type:"button",disabled:y,onClick:()=>{k({browserTools:!i.browserTools})},title:i.browserTools?"Turn off. No worker spawned after this gets a browser.":"Turn on. Workers spawned after this get a headless browser; the director itself gains it when the run is resumed.",style:{...z,justifySelf:"start",background:"none",padding:0,border:"none",borderBottom:"1px dashed var(--line-strong)",cursor:y?"wait":"pointer",font:"inherit",fontFamily:"var(--font-mono)",color:"var(--ink-1)"},children:i.browserTools?"on":"off"}):l.jsx("span",{style:z,children:i.browserTools?"on":"off"}),i.resumes?l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{color:"var(--ink-2)"},children:"resumes"}),l.jsx("span",{style:z,children:i.resumes})]}):null]}),p&&l.jsx("div",{style:{marginTop:4,color:"var(--status-critical)"},children:p})]})}function Vb({p:i,models:c,modelsLoading:u,modelsNote:o,modelsInheritNote:d,routeRunId:h,onSelectRun:m,routeTab:y,onSelectTab:x,onBack:p,refreshFleet:S,auth:b,theme:k,onToggleTheme:w,onSettings:_,settings:X,search:M}){const z=qg(i.id),R=$b(i.id),N=Lg(i.id),[Z,re]=g.useState(null),B=async I=>{const Ce=await I.catch(()=>null);return Ce?Ce.ok?(await N.reload(),null):(await Ce.json().catch(()=>({}))).error??`HTTP ${Ce.status}`:"could not reach the server"},L={...tu,...X.global,...X.project??{}},P=Object.keys(X.project??{}),G=L.gitBranchPerMission!==!1,ce=l.jsxs("span",{style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap",justifyContent:"center"},children:[l.jsx("span",{children:"missions here run on"}),l.jsxs("span",{style:{fontFamily:"var(--font-mono)",color:"var(--ink-1)"},children:[String(L.directorModel??"opus")," · ",String(L.workerModel??"sonnet")]}),l.jsx("span",{children:"· cap"}),l.jsxs("span",{style:{fontFamily:"var(--font-mono)",color:"var(--ink-1)"},children:["$",String(L.budgetCap??6)]}),i.git?.repo&&l.jsxs("span",{children:["· ",G?"each on its own branch":`on ${i.git.branch} directly`]}),P.length>0&&l.jsxs("span",{children:["· ",P.length," project override",P.length===1?"":"s"]}),l.jsx(le,{variant:"ghost",size:"sm",icon:"settings",onClick:_,children:"Change…"})]}),te=i.activeRun?.id??null,ee=h,xe=m;g.useEffect(()=>{te&&m(te)},[te]);const se=te?z.find(I=>I.id===te)?.git?.branch:void 0,me=ee!==null&&ee===te,j=Hg(ee,me),q=qb(ee,j.runStatus),O=z.find(I=>I.id===ee),ue=me&&j.runStatus==="running",[he,T]=g.useState(null),[Q,A]=g.useState(null),F=y,ne=x,[oe,je]=g.useState(()=>{try{const I=Number(localStorage.getItem(Bp));return I>=Zc?I:$p}catch{return $p}}),Ue=I=>{const Ce=Math.max(Zc,Math.floor(window.innerWidth*.5)),St=Math.min(Ce,Math.max(Zc,Math.round(I)));je(St);try{localStorage.setItem(Bp,String(St))}catch{}},ge=I=>{I.preventDefault();const Ce=I.clientX,St=oe,Qn=Xl=>Ue(St+(Ce-Xl.clientX)),tn=()=>{window.removeEventListener("pointermove",Qn),window.removeEventListener("pointerup",tn),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",Qn),window.addEventListener("pointerup",tn)},W=I=>{typeof I.id=="number"&&(he&&he!==I.agent&&T(null),A({id:I.id,n:Date.now()}))},ze=I=>T(he===I?null:I),[ae,Ke]=g.useState(!1),[Ae,wt]=Hb(),[zt,Hl]=g.useState(()=>{try{return localStorage.getItem(Hp)!=="closed"}catch{return!0}}),rn=I=>{Hl(I);try{localStorage.setItem(Hp,I?"open":"closed")}catch{}},[Wn,Bl]=g.useState(!1),[Wa,yr]=g.useState(!1),[qi,bt]=g.useState(!1),[Xa,$l]=g.useState(!1),[ql,Va]=g.useState(!1),[Li,xa]=g.useState(""),[Ll,Yi]=g.useState(!1),[ba,mt]=g.useState(!1),[en,jt]=g.useState(!1),[gn,Qa]=g.useState(null),Gi=O?.git?.pr;g.useEffect(()=>{if(!ee||!Gi){Qa(null);return}if(O?.git?.prState){Qa({runId:ee,state:O.git.prState});return}let I=!1;return Se.prState(ee).then(async Ce=>{const St=Ce.ok?await Ce.json():{state:null};I||Qa({runId:ee,state:St.state})}).catch(()=>{I||Qa({runId:ee,state:null})}),()=>{I=!0}},[ee,Gi,O?.git?.prState]);const ja=async I=>{xa(""),Yi(!0);try{const Ce=await Se.forkPlan(i.id,I);if(!Ce.ok){xa((await Ce.json()).error);return}xe(null)}finally{Yi(!1)}},[Sa,yn]=g.useState(""),[qt,ka]=g.useState(null),[Xn,Yl]=g.useState(!1),Wi=Qp(te?null:i.id),[Ka,xn]=g.useState(!1),bn=Ob(Nb),on=j1(ee,ue),jn=S1(i.id,ee),Za=j.approvals.length+j.questions.length,[wa,Fa]=g.useState(()=>Date.now());g.useEffect(()=>{if(Za===0&&!ue)return;Fa(Date.now());const I=setInterval(()=>Fa(Date.now()),1e4);return()=>clearInterval(I)},[Za,ue]),g.useEffect(()=>{T(null)},[ee]);const Xi=g.useMemo(()=>ue?Ub(j):null,[ue,j]),Vi=g.useMemo(()=>cv(j.missionDoc),[j.missionDoc]),Lt=async(I={})=>{if(!ee)return;xa(""),Ke(!0);const Ce=await Se.resume(ee,I).finally(()=>Ke(!1));Ce.ok?S():xa((await Ce.json()).error)},Je=async(I,Ce=!1)=>{yn(""),ka(null),Yl(!0);let St=I.mission;try{St=await Kp(i.id,I.mission,I.attachments??[])}catch(Xl){yn(Xl.message),Yl(!1);return}const Qn=await Se.run(i.id,St,I.budget,{directorModel:I.directorModel,workerModel:I.workerModel,directorProviderId:I.directorProviderId,workerProviderId:I.workerProviderId,browserTools:I.browserTools,allowDirty:Ce||void 0}).finally(()=>Yl(!1));if(Qn.ok){S();return}const tn=await Qn.json().catch(()=>({}));yn(tn.error??"could not start"),tn.code==="dirty-checkout"&&(yn(`${tn.error}${tn.files?.length?` (${tn.files.join(", ")})`:""}`),ka({v:{...I,mission:St,attachments:[]}}))},gt=!te&&ee===null,cn=!te&&ee&&(O?.status==="interrupted"||O?.status==="error")&&O?.directorSessionId,Gl=bn&&O&&(O.directorModel||O.workerModel)?l.jsxs("span",{title:`director: ${O.directorModel||"default"} · workers: ${O.workerModel||"default"}`,style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:"var(--r-pill)",border:"1px solid var(--line)",background:"var(--bg-inset)",fontSize:"var(--fs-xs)",fontFamily:"var(--font-mono)",color:"var(--ink-1)",maxWidth:260,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[l.jsx(ie,{name:"model",size:11}),O.directorModel||"default"," · ",O.workerModel||"default"]}):null,Ja=O?.scheduleId?N.schedules.find(I=>I.id===O.scheduleId)?.name:void 0,xr=O?.scheduleId?l.jsxs("span",{title:Ja?`Started by the schedule "${Ja}" — nobody pressed anything`:"Started by a schedule that has since been deleted",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:"var(--r-pill)",border:"1px solid var(--line)",background:"var(--bg-inset)",fontSize:"var(--fs-xs)",fontFamily:"var(--font-mono)",color:"var(--ink-1)",maxWidth:260,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[l.jsx(ie,{name:"timeline",size:11}),Ja?`scheduled · ${Ja}`:"scheduled"]}):null,Qi=O&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2,minWidth:0},children:[l.jsx("div",{style:{fontSize:"var(--fs-sm)",fontWeight:"var(--fw-semibold)",color:"var(--ink-0)",lineHeight:"var(--lh)"},title:O.mission,children:O.title||O.mission.split(`
|
|
68
|
+
`).find(I=>I.trim())||"Untitled run"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",fontSize:"var(--fs-xs)",color:"var(--ink-2)",fontVariantNumeric:"tabular-nums",flexWrap:"wrap"},children:[l.jsx("span",{children:new Date(O.createdAt).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}),l.jsx(ya,{status:me?j.runStatus:O.status}),!me&&l.jsx("span",{children:"read-only"})]})]}),Sn=l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[z.length===0&&l.jsx(Qe,{children:"No runs yet."}),z.map(I=>l.jsx(X1,{mission:I.mission,title:I.title,createdAt:I.createdAt,costUsd:I.costUsd,costBasis:ga(I),usage:I.usage,status:I.status,selected:I.id===ee,current:I.id===te,onSelect:I.id===ee?void 0:()=>xe(I.id)},I.id))]}),Ia=l.jsx(hb,{schedules:N.schedules,monthSpendUsd:N.monthSpendUsd,monthlyCapUsd:N.monthlyCapUsd,loading:N.loading,error:N.error,projectId:i.id,onNew:()=>re("new"),onEdit:I=>re(I),onPause:I=>B(Se.pauseSchedule(I.id)),onResume:I=>B(Se.resumeSchedule(I.id)),onRunNow:async I=>{const Ce=await B(Se.runScheduleNow(I.id));return Ce||S(),Ce},onDelete:I=>B(Se.deleteSchedule(I.id))}),kn=(I,Ce)=>l.jsxs("aside",{style:{position:"relative",borderLeft:"1px solid var(--line)",background:"var(--bg-panel)",minHeight:0,minWidth:0,display:"flex",flexDirection:"column"},children:[l.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize the rail",title:"Drag to resize",onPointerDown:ge,style:{position:"absolute",left:-4,top:0,bottom:0,width:8,cursor:"col-resize",zIndex:2}}),I&&l.jsx("div",{style:{padding:"var(--sp-2) var(--sp-3) 0",flex:"0 0 auto"},children:I}),l.jsx("div",{style:{minHeight:0,overflowY:"auto",padding:"var(--sp-3)"},children:Ce})]}),wn=l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)"},children:[Qi,l.jsx(J1,{doc:j.missionDoc}),l.jsx(La,{label:"Mission doc",open:Wn,onToggle:()=>Bl(!Wn),children:l.jsx(C1,{doc:j.missionDoc??void 0})}),R.text.trim()&&l.jsx(La,{label:"Project memory",open:en,onToggle:()=>jt(!en),children:l.jsx("div",{style:{fontSize:"var(--fs-sm)"},children:l.jsx($i,{text:R.text})})}),l.jsx(Db,{agents:j.agents,filter:he,onFilter:ze,sessionId:j.directorSessionId,details:O&&l.jsx(Xb,{r:O,live:me,liveCost:j.costUsd,liveBasis:j.costBasis,liveUsage:j.usage,liveTurns:O.turns,onChanged:S})})]}),Vn=ee?l.jsx(sb,{runId:ee,deck:on.deck,loading:on.loading,error:on.error,missing:on.missing,services:j.services,tree:jn}):null,zn=on.deck?on.deck.totals.files+on.deck.artifacts.length:0,at=l.jsx(sn,{size:"sm",value:F,onChange:I=>ne(I),tabs:[{value:"mission",label:"Mission"},{value:"files",label:"Files",count:zn},{value:"runs",label:"Runs",count:z.length}]}),Ki=l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flex:"0 0 auto",flexWrap:"wrap",padding:"6px var(--sp-3) 0",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:[j.agents.length>1&&l.jsx(W1,{agents:j.agents,filter:he,onFilter:ze}),l.jsx("span",{style:{flex:1}}),j.entries.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(le,{variant:"ghost",size:"sm",icon:"timeline",title:zt?"Hide the timeline":"Show the swimlane timeline — click a tick to jump to its entry",onClick:()=>rn(!zt),children:"Timeline"}),l.jsx(le,{variant:"ghost",size:"sm",icon:"sort",title:Ae==="newest"?"Newest first — click to read oldest first":"Oldest first — click to read newest first",onClick:()=>wt(Ae==="newest"?"oldest":"newest"),children:Ae==="newest"?"Newest first":"Oldest first"})]})]}),Wl=l.jsxs("div",{style:{minHeight:0,minWidth:0,display:"flex",flexDirection:"column"},children:[Ki,zt&&j.entries.length>0&&l.jsx("div",{style:{padding:"6px var(--sp-3) 0",flex:"0 0 auto"},children:l.jsx("div",{style:{background:"var(--bg-panel)",border:"1px solid var(--line)",borderRadius:"var(--r-sm)",padding:"8px 10px"},children:l.jsx(w1,{agents:j.agents,entries:j.entries,live:ue,selected:he,onSelect:ze,onTick:W})})}),!bn&&l.jsxs("div",{style:{padding:"6px var(--sp-3) 0",flex:"0 0 auto",display:"flex",flexDirection:"column",gap:6},children:[l.jsx(La,{label:F1(Vi),open:Wa,onToggle:()=>yr(!Wa),children:wn}),l.jsx(La,{label:`Files · ${zn}`,open:qi,onToggle:()=>bt(!qi),children:Vn}),l.jsx(La,{label:`Runs · ${z.length}`,open:Xa,onToggle:()=>$l(!Xa),children:Sn})]}),l.jsx(Bb,{run:j,filter:he,jump:Q,order:Ae})]});return l.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[l.jsxs(lv,{mode:"project",title:i.name,folder:i.folder,onBack:p,branch:O?.git?{name:O.git.branch,hint:`This mission runs on ${O.git.branch}, made from ${O.git.base}${O.git.commits!==void 0?` · ${O.git.commits} commit${O.git.commits===1?"":"s"} ahead`:""}`}:i.git?.repo&&i.git.branch?{name:i.git.branch,dirty:i.git.dirty}:null,theme:k,onToggleTheme:w,onSettings:_,search:M,children:[Li&&l.jsx(Fe,{tone:"error",inline:!0,children:Li}),ee&&(j.runStatus==="running"&&Za>0?l.jsx("span",{title:`Waiting on you: ${j.approvals.length} approval(s), ${j.questions.length} question(s)`,children:l.jsx(ya,{status:"needs-you"})}):l.jsx(ya,{status:j.runStatus})),ee&&O?.status==="done"&&O?.stopReason==="budget"&&l.jsx("span",{title:"Every DONE WHEN criterion was verified; the run stopped at its cap rather than finishing under it.",style:{fontSize:"var(--fs-xs)",color:"var(--ink-2)",whiteSpace:"nowrap"},children:"at the cap"}),ee&&l.jsx(sv,{spent:j.costUsd,budget:j.budgetUsd,detail:!0,costBasis:j.costBasis,usage:j.usage,turns:O?.turns,elapsedMs:O?.createdAt?(ue?wa:O.endedAt??wa)-O.createdAt:void 0}),xr,Gl,ue&&l.jsx(le,{variant:"danger",onClick:()=>{Se.interrupt(ee)},children:"Interrupt"}),cn&&l.jsx(Ab,{director:O?.directorModel,worker:O?.workerModel,budget:O?.budgetUsd,spent:O?.costUsd,models:c,loading:u,note:o,busy:ae,onResume:I=>{Lt(I)}}),!te&&ee&&O&&O.status!=="running"&&l.jsx(le,{variant:"good",icon:"write",disabled:Ll,title:"Start a new planning conversation that builds on what this mission did",onClick:()=>{ja(ee)},children:Ll?"Opening…":"Plan the next step"}),!te&&ee&&O?.git&&O.status!=="running"&&i.git?.remote&&(O.git.pr?l.jsxs(le,{icon:gn?.state==="merged"?"check":gn?.state==="closed"?"close":"preview",onClick:()=>window.open(O.git.pr,"_blank","noopener"),title:`${O.git.pr}${gn?.state?` · ${gn.state}`:""}`,children:["Pull request",gn?.runId===ee&&gn.state?` · ${gn.state}`:""," ↗"]}):l.jsx(le,{icon:"steer",onClick:()=>mt(!0),title:`Push ${O.git.branch} and open a pull request against ${O.git.base}`,children:"Open pull request…"})),!te&&ee&&l.jsx(le,{variant:"primary",onClick:()=>xe(null),children:"New mission"}),!te&&!ee&&!Ka&&l.jsx(le,{variant:"primary",icon:"write",onClick:()=>xn(!0),title:"Skip the talk: describe the mission and start it",children:"New mission"})]}),ba&&ee&&l.jsx(Gb,{runId:ee,onClose:()=>mt(!1),onDone:()=>S()}),Z&&l.jsx(yb,{schedule:Z==="new"?null:Z,models:c,modelsLoading:u,modelsNote:o,modelsInheritNote:d,defaultBudgetUsd:i.defaultBudgetUsd,onClose:()=>re(null),onPreview:async I=>{const Ce=await Se.previewCadence(I).catch(()=>null);if(!Ce)return{error:"could not reach the server"};const St=await Ce.json().catch(()=>({}));return Ce.ok?{next:St.next??[]}:{error:St.error??`HTTP ${Ce.status}`}},onSave:I=>B(Z==="new"?Se.createSchedule(i.id,I):Se.updateSchedule(Z.id,I))}),ee&&l.jsx(Z1,{approvals:j.approvals,questions:j.questions,now:wa,running:ue,activity:Xi,onAllow:I=>{Se.permission(I,"allow")},onAlways:I=>{Se.permission(I,"allow_always")},onDeny:I=>{Se.permission(I,"deny")},onAnswer:(I,Ce)=>{Se.answer(I,Ce)}}),(i.billingMode??b.mode)==="none"&&l.jsxs(Fe,{tone:"caution",children:["This project has nothing to run on: Claude Code is not signed in on this machine. Sign in and restart Foreman, or give the project a provider of its own.",l.jsx(le,{variant:"ghost",size:"sm",icon:"provider",style:{marginLeft:"var(--sp-2)"},onClick:()=>_("provider"),children:"Settings → Provider"})]}),cn&&O?.stopReason==="budget"&&l.jsxs(Fe,{tone:"caution",children:["This run stopped at its $",O.budgetUsd.toFixed(2)," cap with $",O.costUsd.toFixed(2)," spent. Raise the cap and continue:",[5,10].map(I=>l.jsxs(le,{variant:"good",size:"sm",icon:"resume",disabled:ae,style:{marginLeft:"var(--sp-2)"},onClick:()=>{Lt({budgetUsd:Math.round((O.budgetUsd+I)*100)/100})},children:["+$",I," & resume"]},I)),l.jsx(le,{variant:"good",size:"sm",icon:"resume",disabled:ae,style:{marginLeft:"var(--sp-2)"},onClick:()=>{Lt({budgetUsd:Math.round(O.budgetUsd*2*100)/100})},children:"Double & resume"})]}),cn&&O?.stopReason&&O.stopReason!=="budget"&&l.jsxs(Fe,{tone:"caution",children:["This run stopped at its ",O.stopReason==="turns"?"turn":O.stopReason==="time"?"time":"token"," cap. Resume continues it with a fresh allowance."]}),ee&&l.jsx(Lb,{runId:ee,services:q.list,onDone:q.refresh}),se&&l.jsxs(Fe,{tone:"caution",children:["This checkout is held by the running mission, on"," ",l.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:se}),". Commits you make in the folder land on that branch, and anything left uncommitted joins the mission's closing commit."]}),ee&&!me&&l.jsxs(Fe,{tone:"readonly",children:["Viewing a past run (read-only).",l.jsx(le,{variant:"ghost",size:"sm",icon:"back",style:{marginLeft:"var(--sp-2)"},onClick:()=>xe(te??null),children:te?"Back to the live run":"Back to planning"})]}),gt?l.jsxs("div",{style:{flex:1,minHeight:0,minWidth:0,display:bn?"grid":"flex",flexDirection:"column",gridTemplateColumns:bn?`minmax(0, 1fr) ${oe}px`:void 0},children:[l.jsxs("div",{style:{minHeight:0,minWidth:0,display:"flex",flexDirection:"column"},children:[!bn&&l.jsxs("div",{style:{padding:"6px var(--sp-3) 0",flex:"0 0 auto",display:"flex",flexDirection:"column",gap:6},children:[l.jsx(La,{label:`Schedules · ${N.schedules.length}`,open:ql,onToggle:()=>Va(!ql),children:Ia}),z.length>0&&l.jsx(La,{label:`Runs · ${z.length}`,open:Xa,onToggle:()=>$l(!Xa),children:Sn})]}),Ka?l.jsxs("div",{style:{flex:1,minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column"},children:[l.jsx("div",{style:{padding:"var(--sp-2) var(--sp-3) 0",flex:"0 0 auto"},children:l.jsx(le,{variant:"ghost",size:"sm",icon:"back",onClick:()=>xn(!1),children:"Back to the conversation"})}),l.jsxs("div",{style:{margin:"auto",width:"100%",padding:"var(--sp-4) 0 var(--sp-5)"},children:[l.jsx(H1,{folder:i.folder,defaultBudgetUsd:i.defaultBudgetUsd,error:Sa,errorAction:qt?{label:"Start anyway",onClick:()=>{Je(qt.v,!0)}}:void 0,busy:Xn,models:c,modelsLoading:u,modelsNote:o,modelsInheritNote:d,onStart:I=>{Je(I)},style:{background:"var(--bg-panel)",border:"1px solid var(--line)",borderRadius:"var(--r-md)",padding:"var(--sp-5)",margin:"0 auto",boxSizing:"border-box"}}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",flexWrap:"wrap",margin:"var(--sp-3) auto 0",maxWidth:"var(--composer-max)",fontSize:"var(--fs-xs)",color:"var(--ink-2)"},children:[l.jsx(Jp,{mode:i.billingMode??b.mode,compact:!0,account:b.account,source:Rb(i,b.source)}),l.jsxs("span",{style:{fontFamily:"var(--font-mono)"},children:["runs on ",Gp(i.provider)??"the server default instance"]}),i.git?.repo&&l.jsxs("span",{title:G?"Foreman creates the branch from what is checked out, commits the mission's work on it at the end, and never merges or pushes. Settings → Projects turns this off.":"The mission edits the current branch. Settings → Projects can give each mission a branch of its own.",children:["· ",G?l.jsxs(l.Fragment,{children:["on its own branch from ",l.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:i.git.branch})]}):l.jsxs(l.Fragment,{children:["on ",l.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:i.git.branch})," directly"]})]})]})]})]}):l.jsx(l.Fragment,{children:l.jsx(Wb,{chat:Wi,folder:i.folder,starting:Xn,error:Sa,errorAction:qt?{label:"Start anyway",onClick:()=>{Je(qt.v,!0)}}:void 0,models:c,modelsLoading:u,modelsNote:o,modelsInheritNote:d,onStart:I=>{Je(I)},onCompose:()=>xn(!0),hasRuns:z.length>0,recent:z,runsOn:ce,onOpenRun:I=>xe(I),onForkRun:I=>{ja(I)},forking:Ll,projectId:i.id,onSettings:_})})]}),bn&&kn(null,l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:[Ia,l.jsx(Yb,{memory:R}),l.jsx(eu,{files:jn.files,truncated:jn.truncated,loading:jn.loading,error:jn.error,onRefresh:jn.refresh,urlBase:`/projects/${encodeURIComponent(i.id)}`},i.id)]}))]}):l.jsxs("main",{style:{flex:1,minHeight:0,minWidth:0,display:"flex",flexDirection:"column"},children:[bn?l.jsxs("div",{style:{flex:1,minHeight:0,display:"grid",gridTemplateColumns:`minmax(0, 1fr) ${oe}px`},children:[Wl,kn(at,F==="mission"?wn:F==="files"?Vn:Sn)]}):l.jsx("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:Wl}),me&&l.jsx("div",{style:{padding:"var(--sp-2) var(--sp-3) var(--sp-3)",flex:"0 0 auto"},children:l.jsx(L1,{agents:[{id:"director",status:j.runStatus==="running"?"running":"done"}],to:"director",onTo:()=>{},timing:"next",onTiming:()=>{},disabled:j.runStatus!=="running",disabledReason:"Run finished — start a new mission.",onSend:I=>{Se.steer(ee,I)}})})]})]})}const Lp={small:.88,default:1,large:1.15,larger:1.3};function Qb(){const i=g.useCallback(c=>{const u=Lp[c]??1;document.documentElement.style.setProperty("--ui-scale",String(u));try{localStorage.setItem("foreman:textSize",c)}catch{}},[]);return g.useEffect(()=>{let c=null;try{c=localStorage.getItem("foreman:textSize")}catch{}c&&c in Lp&&i(c)},[i]),i}function Kb(){const[i,c]=g.useState(()=>localStorage.getItem("foreman:theme")||"light");g.useEffect(()=>{document.documentElement.dataset.theme=i,localStorage.setItem("foreman:theme",i)},[i]);const u=g.useCallback(o=>{c(o==="system"?window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark":o)},[]);return[i,()=>c(o=>o==="dark"?"light":"dark"),u]}function Zb(i){const[c,u]=g.useState({models:null,loading:!0});return g.useEffect(()=>{let o=!0;u(h=>({...h,loading:!0}));const d=i?`/models?projectId=${encodeURIComponent(i)}`:"/models";return fetch(d).then(h=>h.ok?h.json():null).then(h=>{if(o){if(!h)return u({models:null,loading:!1});u({models:h.models,loading:!1,note:h.reachable===!1?`Cannot reach ${h.endpoint??"this project’s endpoint"}.`:h.models?.length===0?"This endpoint has no models installed.":void 0,inheritNote:h.provider&&h.provider!=="claude-code"?"inherits this project’s provider default":void 0})}}).catch(()=>o&&u({models:null,loading:!1})),()=>{o=!1}},[i]),c}function Fb(i){const[c,u]=g.useState({instances:[],ollama:null,codex:null});return g.useEffect(()=>{if(!i)return;let o=!0;return fetch("/instances").then(d=>d.ok?d.json():null).then(d=>{o&&d&&u({instances:d.instances??[],ollama:d.ollama??null,codex:d.codex??null})}).catch(()=>{}),()=>{o=!1}},[i]),c}function Jb(){const{projects:i,connected:c,auth:u,refresh:o,activity:d,update:h,version:m,firstRun:y}=$g(),{setup:x,projectId:p,runId:S,tab:b,go:k,goRun:w}=Vg(),[_,X,M]=Kb(),z=Qb(),R=Zb(p),[N,Z]=g.useState({global:{},projects:{}}),[re,B]=g.useState(!1),[L,P]=g.useState("models"),G=W=>{W&&P(W),B(!0)},ce=Fb(re);g.useEffect(()=>{fetch("/settings").then(W=>W.ok?W.json():null).then(W=>W&&Z(W)).catch(()=>{})},[]);const te=p?i.find(W=>W.id===p):null,[ee,xe]=g.useState(!1),[se,me]=g.useState(""),j=async(W,ze)=>{me(""),xe(!0);const ae=await(ze===null?Se.clearProviderKey(W):Se.setProviderKey(W,ze)).finally(()=>xe(!1));ae.ok?o():me((await ae.json().catch(()=>({}))).error??"could not save the key")},q=async W=>{const ze={global:W.global,projects:{...N.projects}};te&&(Object.keys(W.project).length?ze.projects[te.id]=W.project:delete ze.projects[te.id]),Z(ze),B(!1),W.global.theme&&M(W.global.theme),W.global.textSize&&z(W.global.textSize),await fetch("/settings",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({global:W.global,projectId:te?.id,project:te?ze.projects[te.id]??{}:void 0})}).catch(()=>{}),te&&W.provider!==void 0&&(await Se.updateProject(te.id,{provider:W.provider}).catch(()=>{}),o())},[O,ue]=g.useState(""),he=O.trim().toLowerCase(),T=Gg(he),Q=W=>new Date(W).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),A=he?i.filter(W=>[W.name,W.folder].some(ze=>ze.toLowerCase().includes(he))).slice(0,8):[],F=[{id:"act-fleet",title:"Fleet",detail:"The board: what needs you, what is running, what finished",icon:"back",keys:"fleet home board",onPick:()=>k(null)},{id:"act-settings",title:"Settings",detail:te?`Global, and ${te.name}'s overrides`:"Models, budget, approvals, notifications",icon:"settings",keys:"settings preferences models budget telegram",onPick:()=>B(!0)},...te?[{id:"act-plan",title:`Plan in ${te.name}`,detail:"Back to the planning conversation",icon:"steer",keys:"plan planner mission new",onPick:()=>k(te.id)}]:[]].filter(W=>he&&(W.title.toLowerCase().includes(he)||W.keys.includes(he))),ne=[{label:"Projects",items:A.map(W=>({id:`p-${W.id}`,title:W.name,detail:W.folder,icon:"folder",onPick:()=>k(W.id)}))},{label:"Runs",count:T.hits.length>=30?30:void 0,items:T.hits.map(W=>({id:`r-${W.id}`,title:W.title||W.mission,detail:`${W.projectName}${W.title?` · ${W.mission}`:""}`,icon:"idle",status:W.status,meta:`${Q(W.endedAt??W.createdAt)}${W.costBasis==="priced"?` · $${W.costUsd.toFixed(2)}`:""}`,onPick:()=>{W.projectId&&w(W.projectId,W.id)}}))},{label:"Actions",items:F}],oe=l.jsx(z0,{value:O,onChange:ue,groups:ne,busy:T.busy}),je={theme:_,onToggleTheme:X,search:oe,onSettings:W=>G(W),auth:u},Ue=Xg(),ge=Ue.status?Ue.status.telegram.chatId?Ue.status.telegram.chatLabel??"linked":null:void 0;return l.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[l.jsx("div",{style:{flex:1,minHeight:0},children:x||y===!0&&!te?l.jsx(x1,{onDone:()=>{Se.setupDone().then(()=>o()),x&&k(null)},onSettings:W=>G(W)}):te?l.jsx(Vb,{p:te,models:R.models,modelsLoading:R.loading,modelsNote:R.note,modelsInheritNote:R.inheritNote,routeRunId:S,onSelectRun:W=>w(te.id,W),routeTab:b,onSelectTab:W=>S&&w(te.id,S,W),onBack:()=>k(null),refreshFleet:o,settings:{global:N.global,project:N.projects[te.id]},...je}):l.jsx(g1,{projects:i,connected:c,activity:d,onOpen:W=>k(W),onOpenRun:(W,ze)=>w(W,ze),refresh:o,query:O,onQuery:ue,...je})}),l.jsx(T0,{connected:c,localUrl:window.location.origin,publicUrl:Ue.status?.publicUrl,phone:ge,auth:u,version:m,update:h,onOpenSettings:G}),re&&l.jsx(Tb,{scope:te?"project":"global",section:L,onSection:P,global:N.global,project:te?N.projects[te.id]:void 0,projectName:te?.name,models:R.models,modelsLoading:R.loading,modelsNote:R.note,provider:te?.provider??null,providerInstances:ce.instances,providerOllama:ce.ollama,providerCodex:ce.codex,providerHasKey:te?.providerHasKey,providerKeyBusy:ee,providerKeyError:se,onStoreProviderKey:(W,ze)=>{j(W,ze)},onClearProviderKey:W=>{j(W,null)},notify:Ue,onSave:W=>{q(W)},onClose:()=>B(!1)})]})}Dg.createRoot(document.getElementById("root")).render(l.jsx(g.StrictMode,{children:l.jsx(Jb,{})}));
|