@tt-a1i/hive 2.1.13 → 2.1.14
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/CHANGELOG.md +14 -0
- package/dist/src/server/team-memory-dream-prompt.js +4 -2
- package/package.json +1 -1
- package/web/dist/assets/{AddWorkerDialog-DcEIii34.js → AddWorkerDialog-BdIc_ZDz.js} +2 -2
- package/web/dist/assets/{AddWorkspaceFlow-BTYcc0tV.js → AddWorkspaceFlow-h-UH433o.js} +1 -1
- package/web/dist/assets/{FirstRunWizard-Bdb1l71P.js → FirstRunWizard-ChuB1siy.js} +1 -1
- package/web/dist/assets/{MarketplaceDrawer-C1MjJMok.js → MarketplaceDrawer-BHTvxLMz.js} +1 -1
- package/web/dist/assets/{TaskGraphDrawer-DFYARCjj.js → TaskGraphDrawer-woCXhUwp.js} +1 -1
- package/web/dist/assets/{WhatsNewDialog-rUU_Roz8.js → WhatsNewDialog-BcRbRAJI.js} +1 -1
- package/web/dist/assets/{WorkerModal-CuB3F-m-.js → WorkerModal-CTf1k881.js} +1 -1
- package/web/dist/assets/{WorkflowsDrawer-Bk87nnDw.js → WorkflowsDrawer-Diw0TiiJ.js} +1 -1
- package/web/dist/assets/{WorkspaceMemoryDrawer-DPfFpEwj.js → WorkspaceMemoryDrawer-B7Z1_COx.js} +1 -1
- package/web/dist/assets/{WorkspaceTaskDrawer-DOWlwBCm.js → WorkspaceTaskDrawer-D10RcAUj.js} +1 -1
- package/web/dist/assets/index-BTaZgzo0.js +84 -0
- package/web/dist/assets/{search-DFKWO_9l.js → search-D6bjVJKH.js} +1 -1
- package/web/dist/assets/{square-terminal-D54LkZqa.js → square-terminal-BUBEjTQZ.js} +1 -1
- package/web/dist/index.html +1 -1
- package/web/dist/sw.js +1 -1
- package/web/dist/assets/index-XUIK5lOA.js +0 -84
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WorkspaceTaskDrawer-DOWlwBCm.js","assets/TaskGraphDrawer-DFYARCjj.js","assets/AddWorkerDialog-DcEIii34.js","assets/search-DFKWO_9l.js","assets/square-terminal-D54LkZqa.js","assets/WorkflowsDrawer-Bk87nnDw.js","assets/WorkspaceMemoryDrawer-DPfFpEwj.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
function K2(t,a){for(var o=0;o<a.length;o++){const i=a[o];if(typeof i!="string"&&!Array.isArray(i)){for(const l in i)if(l!=="default"&&!(l in t)){const u=Object.getOwnPropertyDescriptor(i,l);u&&Object.defineProperty(t,l,u.get?u:{enumerable:!0,get:()=>i[l]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&i(f)}).observe(document,{childList:!0,subtree:!0});function o(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function i(l){if(l.ep)return;l.ep=!0;const u=o(l);fetch(l.href,u)}})();function Yb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Gd={exports:{}},Os={};var ey;function Y2(){if(ey)return Os;ey=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function o(i,l,u){var f=null;if(u!==void 0&&(f=""+u),l.key!==void 0&&(f=""+l.key),"key"in l){u={};for(var p in l)p!=="key"&&(u[p]=l[p])}else u=l;return l=u.ref,{$$typeof:t,type:i,key:f,ref:l!==void 0?l:null,props:u}}return Os.Fragment=a,Os.jsx=o,Os.jsxs=o,Os}var ty;function $2(){return ty||(ty=1,Gd.exports=Y2()),Gd.exports}var c=$2(),Xd={exports:{}},Ne={};var ny;function V2(){if(ny)return Ne;ny=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),k=Symbol.iterator;function S(R){return R===null||typeof R!="object"?null:(R=k&&R[k]||R["@@iterator"],typeof R=="function"?R:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,C={};function T(R,B,se){this.props=R,this.context=B,this.refs=C,this.updater=se||E}T.prototype.isReactComponent={},T.prototype.setState=function(R,B){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,B,"setState")},T.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function N(){}N.prototype=T.prototype;function A(R,B,se){this.props=R,this.context=B,this.refs=C,this.updater=se||E}var j=A.prototype=new N;j.constructor=A,w(j,T.prototype),j.isPureReactComponent=!0;var O=Array.isArray;function D(){}var L={H:null,A:null,T:null,S:null},q=Object.prototype.hasOwnProperty;function $(R,B,se){var te=se.ref;return{$$typeof:t,type:R,key:B,ref:te!==void 0?te:null,props:se}}function ae(R,B){return $(R.type,B,R.props)}function G(R){return typeof R=="object"&&R!==null&&R.$$typeof===t}function W(R){var B={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(se){return B[se]})}var ee=/\/+/g;function Q(R,B){return typeof R=="object"&&R!==null&&R.key!=null?W(""+R.key):B.toString(36)}function V(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(D,D):(R.status="pending",R.then(function(B){R.status==="pending"&&(R.status="fulfilled",R.value=B)},function(B){R.status==="pending"&&(R.status="rejected",R.reason=B)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function M(R,B,se,te,fe){var me=typeof R;(me==="undefined"||me==="boolean")&&(R=null);var ue=!1;if(R===null)ue=!0;else switch(me){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(R.$$typeof){case t:case a:ue=!0;break;case b:return ue=R._init,M(ue(R._payload),B,se,te,fe)}}if(ue)return fe=fe(R),ue=te===""?"."+Q(R,0):te,O(fe)?(se="",ue!=null&&(se=ue.replace(ee,"$&/")+"/"),M(fe,B,se,"",function(ce){return ce})):fe!=null&&(G(fe)&&(fe=ae(fe,se+(fe.key==null||R&&R.key===fe.key?"":(""+fe.key).replace(ee,"$&/")+"/")+ue)),B.push(fe)),1;ue=0;var ie=te===""?".":te+":";if(O(R))for(var le=0;le<R.length;le++)te=R[le],me=ie+Q(te,le),ue+=M(te,B,se,me,fe);else if(le=S(R),typeof le=="function")for(R=le.call(R),le=0;!(te=R.next()).done;)te=te.value,me=ie+Q(te,le++),ue+=M(te,B,se,me,fe);else if(me==="object"){if(typeof R.then=="function")return M(V(R),B,se,te,fe);throw B=String(R),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return ue}function P(R,B,se){if(R==null)return R;var te=[],fe=0;return M(R,te,"","",function(me){return B.call(se,me,fe++)}),te}function I(R){if(R._status===-1){var B=R._result;B=B(),B.then(function(se){(R._status===0||R._status===-1)&&(R._status=1,R._result=se)},function(se){(R._status===0||R._status===-1)&&(R._status=2,R._result=se)}),R._status===-1&&(R._status=0,R._result=B)}if(R._status===1)return R._result.default;throw R._result}var Z=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},F={map:P,forEach:function(R,B,se){P(R,function(){B.apply(this,arguments)},se)},count:function(R){var B=0;return P(R,function(){B++}),B},toArray:function(R){return P(R,function(B){return B})||[]},only:function(R){if(!G(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Ne.Activity=v,Ne.Children=F,Ne.Component=T,Ne.Fragment=o,Ne.Profiler=l,Ne.PureComponent=A,Ne.StrictMode=i,Ne.Suspense=g,Ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Ne.__COMPILER_RUNTIME={__proto__:null,c:function(R){return L.H.useMemoCache(R)}},Ne.cache=function(R){return function(){return R.apply(null,arguments)}},Ne.cacheSignal=function(){return null},Ne.cloneElement=function(R,B,se){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var te=w({},R.props),fe=R.key;if(B!=null)for(me in B.key!==void 0&&(fe=""+B.key),B)!q.call(B,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&B.ref===void 0||(te[me]=B[me]);var me=arguments.length-2;if(me===1)te.children=se;else if(1<me){for(var ue=Array(me),ie=0;ie<me;ie++)ue[ie]=arguments[ie+2];te.children=ue}return $(R.type,fe,te)},Ne.createContext=function(R){return R={$$typeof:f,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:u,_context:R},R},Ne.createElement=function(R,B,se){var te,fe={},me=null;if(B!=null)for(te in B.key!==void 0&&(me=""+B.key),B)q.call(B,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(fe[te]=B[te]);var ue=arguments.length-2;if(ue===1)fe.children=se;else if(1<ue){for(var ie=Array(ue),le=0;le<ue;le++)ie[le]=arguments[le+2];fe.children=ie}if(R&&R.defaultProps)for(te in ue=R.defaultProps,ue)fe[te]===void 0&&(fe[te]=ue[te]);return $(R,me,fe)},Ne.createRef=function(){return{current:null}},Ne.forwardRef=function(R){return{$$typeof:p,render:R}},Ne.isValidElement=G,Ne.lazy=function(R){return{$$typeof:b,_payload:{_status:-1,_result:R},_init:I}},Ne.memo=function(R,B){return{$$typeof:m,type:R,compare:B===void 0?null:B}},Ne.startTransition=function(R){var B=L.T,se={};L.T=se;try{var te=R(),fe=L.S;fe!==null&&fe(se,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(D,Z)}catch(me){Z(me)}finally{B!==null&&se.types!==null&&(B.types=se.types),L.T=B}},Ne.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},Ne.use=function(R){return L.H.use(R)},Ne.useActionState=function(R,B,se){return L.H.useActionState(R,B,se)},Ne.useCallback=function(R,B){return L.H.useCallback(R,B)},Ne.useContext=function(R){return L.H.useContext(R)},Ne.useDebugValue=function(){},Ne.useDeferredValue=function(R,B){return L.H.useDeferredValue(R,B)},Ne.useEffect=function(R,B){return L.H.useEffect(R,B)},Ne.useEffectEvent=function(R){return L.H.useEffectEvent(R)},Ne.useId=function(){return L.H.useId()},Ne.useImperativeHandle=function(R,B,se){return L.H.useImperativeHandle(R,B,se)},Ne.useInsertionEffect=function(R,B){return L.H.useInsertionEffect(R,B)},Ne.useLayoutEffect=function(R,B){return L.H.useLayoutEffect(R,B)},Ne.useMemo=function(R,B){return L.H.useMemo(R,B)},Ne.useOptimistic=function(R,B){return L.H.useOptimistic(R,B)},Ne.useReducer=function(R,B,se){return L.H.useReducer(R,B,se)},Ne.useRef=function(R){return L.H.useRef(R)},Ne.useState=function(R){return L.H.useState(R)},Ne.useSyncExternalStore=function(R,B,se){return L.H.useSyncExternalStore(R,B,se)},Ne.useTransition=function(){return L.H.useTransition()},Ne.version="19.2.5",Ne}var ay;function km(){return ay||(ay=1,Xd.exports=V2()),Xd.exports}var y=km();const G2=Yb(y),$b=K2({__proto__:null,default:G2},[y]);var Zd={exports:{}},Ds={},Qd={exports:{}},Jd={};var ry;function X2(){return ry||(ry=1,(function(t){function a(M,P){var I=M.length;M.push(P);e:for(;0<I;){var Z=I-1>>>1,F=M[Z];if(0<l(F,P))M[Z]=P,M[I]=F,I=Z;else break e}}function o(M){return M.length===0?null:M[0]}function i(M){if(M.length===0)return null;var P=M[0],I=M.pop();if(I!==P){M[0]=I;e:for(var Z=0,F=M.length,R=F>>>1;Z<R;){var B=2*(Z+1)-1,se=M[B],te=B+1,fe=M[te];if(0>l(se,I))te<F&&0>l(fe,se)?(M[Z]=fe,M[te]=I,Z=te):(M[Z]=se,M[B]=I,Z=B);else if(te<F&&0>l(fe,I))M[Z]=fe,M[te]=I,Z=te;else break e}}return P}function l(M,P){var I=M.sortIndex-P.sortIndex;return I!==0?I:M.id-P.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var f=Date,p=f.now();t.unstable_now=function(){return f.now()-p}}var g=[],m=[],b=1,v=null,k=3,S=!1,E=!1,w=!1,C=!1,T=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function j(M){for(var P=o(m);P!==null;){if(P.callback===null)i(m);else if(P.startTime<=M)i(m),P.sortIndex=P.expirationTime,a(g,P);else break;P=o(m)}}function O(M){if(w=!1,j(M),!E)if(o(g)!==null)E=!0,D||(D=!0,W());else{var P=o(m);P!==null&&V(O,P.startTime-M)}}var D=!1,L=-1,q=5,$=-1;function ae(){return C?!0:!(t.unstable_now()-$<q)}function G(){if(C=!1,D){var M=t.unstable_now();$=M;var P=!0;try{e:{E=!1,w&&(w=!1,N(L),L=-1),S=!0;var I=k;try{t:{for(j(M),v=o(g);v!==null&&!(v.expirationTime>M&&ae());){var Z=v.callback;if(typeof Z=="function"){v.callback=null,k=v.priorityLevel;var F=Z(v.expirationTime<=M);if(M=t.unstable_now(),typeof F=="function"){v.callback=F,j(M),P=!0;break t}v===o(g)&&i(g),j(M)}else i(g);v=o(g)}if(v!==null)P=!0;else{var R=o(m);R!==null&&V(O,R.startTime-M),P=!1}}break e}finally{v=null,k=I,S=!1}P=void 0}}finally{P?W():D=!1}}}var W;if(typeof A=="function")W=function(){A(G)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,Q=ee.port2;ee.port1.onmessage=G,W=function(){Q.postMessage(null)}}else W=function(){T(G,0)};function V(M,P){L=T(function(){M(t.unstable_now())},P)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(M){M.callback=null},t.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<M?Math.floor(1e3/M):5},t.unstable_getCurrentPriorityLevel=function(){return k},t.unstable_next=function(M){switch(k){case 1:case 2:case 3:var P=3;break;default:P=k}var I=k;k=P;try{return M()}finally{k=I}},t.unstable_requestPaint=function(){C=!0},t.unstable_runWithPriority=function(M,P){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var I=k;k=M;try{return P()}finally{k=I}},t.unstable_scheduleCallback=function(M,P,I){var Z=t.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?Z+I:Z):I=Z,M){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=I+F,M={id:b++,callback:P,priorityLevel:M,startTime:I,expirationTime:F,sortIndex:-1},I>Z?(M.sortIndex=I,a(m,M),o(g)===null&&M===o(m)&&(w?(N(L),L=-1):w=!0,V(O,I-Z))):(M.sortIndex=F,a(g,M),E||S||(E=!0,D||(D=!0,W()))),M},t.unstable_shouldYield=ae,t.unstable_wrapCallback=function(M){var P=k;return function(){var I=k;k=P;try{return M.apply(this,arguments)}finally{k=I}}}})(Jd)),Jd}var oy;function Z2(){return oy||(oy=1,Qd.exports=X2()),Qd.exports}var ef={exports:{}},kt={};var sy;function Q2(){if(sy)return kt;sy=1;var t=km();function a(g){var m="https://react.dev/errors/"+g;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)m+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var i={d:{f:o,r:function(){throw Error(a(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},l=Symbol.for("react.portal");function u(g,m,b){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:v==null?null:""+v,children:g,containerInfo:m,implementation:b}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,m){if(g==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return kt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,kt.createPortal=function(g,m){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(a(299));return u(g,m,null,b)},kt.flushSync=function(g){var m=f.T,b=i.p;try{if(f.T=null,i.p=2,g)return g()}finally{f.T=m,i.p=b,i.d.f()}},kt.preconnect=function(g,m){typeof g=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,i.d.C(g,m))},kt.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},kt.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var b=m.as,v=p(b,m.crossOrigin),k=typeof m.integrity=="string"?m.integrity:void 0,S=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?i.d.S(g,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:v,integrity:k,fetchPriority:S}):b==="script"&&i.d.X(g,{crossOrigin:v,integrity:k,fetchPriority:S,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},kt.preinitModule=function(g,m){if(typeof g=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var b=p(m.as,m.crossOrigin);i.d.M(g,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&i.d.M(g)},kt.preload=function(g,m){if(typeof g=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var b=m.as,v=p(b,m.crossOrigin);i.d.L(g,b,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},kt.preloadModule=function(g,m){if(typeof g=="string")if(m){var b=p(m.as,m.crossOrigin);i.d.m(g,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else i.d.m(g)},kt.requestFormReset=function(g){i.d.r(g)},kt.unstable_batchedUpdates=function(g,m){return g(m)},kt.useFormState=function(g,m,b){return f.H.useFormState(g,m,b)},kt.useFormStatus=function(){return f.H.useHostTransitionStatus()},kt.version="19.2.5",kt}var iy;function Vb(){if(iy)return ef.exports;iy=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(a){console.error(a)}}return t(),ef.exports=Q2(),ef.exports}var ly;function J2(){if(ly)return Ds;ly=1;var t=Z2(),a=km(),o=Vb();function i(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)n+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var n=e,r=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(r=n.return),e=n.return;while(e)}return n.tag===3?r:null}function f(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function p(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function g(e){if(u(e)!==e)throw Error(i(188))}function m(e){var n=e.alternate;if(!n){if(n=u(e),n===null)throw Error(i(188));return n!==e?null:e}for(var r=e,s=n;;){var d=r.return;if(d===null)break;var h=d.alternate;if(h===null){if(s=d.return,s!==null){r=s;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===r)return g(d),e;if(h===s)return g(d),n;h=h.sibling}throw Error(i(188))}if(r.return!==s.return)r=d,s=h;else{for(var x=!1,_=d.child;_;){if(_===r){x=!0,r=d,s=h;break}if(_===s){x=!0,s=d,r=h;break}_=_.sibling}if(!x){for(_=h.child;_;){if(_===r){x=!0,r=h,s=d;break}if(_===s){x=!0,s=h,r=d;break}_=_.sibling}if(!x)throw Error(i(189))}}if(r.alternate!==s)throw Error(i(190))}if(r.tag!==3)throw Error(i(188));return r.stateNode.current===r?e:n}function b(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=b(e),n!==null)return n;e=e.sibling}return null}var v=Object.assign,k=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),A=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),ae=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function W(e){return e===null||typeof e!="object"?null:(e=G&&e[G]||e["@@iterator"],typeof e=="function"?e:null)}var ee=Symbol.for("react.client.reference");function Q(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ee?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case T:return"Profiler";case C:return"StrictMode";case O:return"Suspense";case D:return"SuspenseList";case $:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case A:return e.displayName||"Context";case N:return(e._context.displayName||"Context")+".Consumer";case j:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case L:return n=e.displayName||null,n!==null?n:Q(e.type)||"Memo";case q:n=e._payload,e=e._init;try{return Q(e(n))}catch{}}return null}var V=Array.isArray,M=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},Z=[],F=-1;function R(e){return{current:e}}function B(e){0>F||(e.current=Z[F],Z[F]=null,F--)}function se(e,n){F++,Z[F]=e.current,e.current=n}var te=R(null),fe=R(null),me=R(null),ue=R(null);function ie(e,n){switch(se(me,n),se(fe,e),se(te,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?Sv(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=Sv(n),e=Ev(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(te),se(te,e)}function le(){B(te),B(fe),B(me)}function ce(e){e.memoizedState!==null&&se(ue,e);var n=te.current,r=Ev(n,e.type);n!==r&&(se(fe,e),se(te,r))}function de(e){fe.current===e&&(B(te),B(fe)),ue.current===e&&(B(ue),js._currentValue=I)}var Te,xe;function qe(e){if(Te===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);Te=n&&n[1]||"",xe=-1<r.stack.indexOf(`
|
|
3
|
-
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
-
`+Te+e+xe}var Qe=!1;function _t(e,n){if(!e||Qe)return"";Qe=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(J){var X=J}Reflect.construct(e,[],oe)}else{try{oe.call()}catch(J){X=J}e.call(oe.prototype)}}else{try{throw Error()}catch(J){X=J}(oe=e())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(J){if(J&&X&&typeof J.stack=="string")return[J.stack,X.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=s.DetermineComponentFrameRoot(),x=h[0],_=h[1];if(x&&_){var z=x.split(`
|
|
5
|
-
`),Y=_.split(`
|
|
6
|
-
`);for(d=s=0;s<z.length&&!z[s].includes("DetermineComponentFrameRoot");)s++;for(;d<Y.length&&!Y[d].includes("DetermineComponentFrameRoot");)d++;if(s===z.length||d===Y.length)for(s=z.length-1,d=Y.length-1;1<=s&&0<=d&&z[s]!==Y[d];)d--;for(;1<=s&&0<=d;s--,d--)if(z[s]!==Y[d]){if(s!==1||d!==1)do if(s--,d--,0>d||z[s]!==Y[d]){var ne=`
|
|
7
|
-
`+z[s].replace(" at new "," at ");return e.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",e.displayName)),ne}while(1<=s&&0<=d);break}}}finally{Qe=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?qe(r):""}function nn(e,n){switch(e.tag){case 26:case 27:case 5:return qe(e.type);case 16:return qe("Lazy");case 13:return e.child!==n&&n!==null?qe("Suspense Fallback"):qe("Suspense");case 19:return qe("SuspenseList");case 0:case 15:return _t(e.type,!1);case 11:return _t(e.type.render,!1);case 1:return _t(e.type,!0);case 31:return qe("Activity");default:return""}}function an(e){try{var n="",r=null;do n+=nn(e,r),r=e,e=e.return;while(e);return n}catch(s){return`
|
|
8
|
-
Error generating stack: `+s.message+`
|
|
9
|
-
`+s.stack}}var jn=Object.prototype.hasOwnProperty,De=t.unstable_scheduleCallback,vn=t.unstable_cancelCallback,fa=t.unstable_shouldYield,ma=t.unstable_requestPaint,we=t.unstable_now,at=t.unstable_getCurrentPriorityLevel,In=t.unstable_ImmediatePriority,ke=t.unstable_UserBlockingPriority,Re=t.unstable_NormalPriority,ve=t.unstable_LowPriority,Oe=t.unstable_IdlePriority,rn=t.log,Uo=t.unstable_setDisableYieldValue,Wo=null,qt=null;function pa(e){if(typeof rn=="function"&&Uo(e),qt&&typeof qt.setStrictMode=="function")try{qt.setStrictMode(Wo,e)}catch{}}var Pt=Math.clz32?Math.clz32:R1,_1=Math.log,A1=Math.LN2;function R1(e){return e>>>=0,e===0?32:31-(_1(e)/A1|0)|0}var di=256,fi=262144,mi=4194304;function er(e){var n=e&42;if(n!==0)return n;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 pi(e,n,r){var s=e.pendingLanes;if(s===0)return 0;var d=0,h=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var _=s&134217727;return _!==0?(s=_&~h,s!==0?d=er(s):(x&=_,x!==0?d=er(x):r||(r=_&~e,r!==0&&(d=er(r))))):(_=s&~h,_!==0?d=er(_):x!==0?d=er(x):r||(r=s&~e,r!==0&&(d=er(r)))),d===0?0:n!==0&&n!==d&&(n&h)===0&&(h=d&-d,r=n&-n,h>=r||h===32&&(r&4194048)!==0)?n:d}function Io(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function O1(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function rp(){var e=mi;return mi<<=1,(mi&62914560)===0&&(mi=4194304),e}function Hc(e){for(var n=[],r=0;31>r;r++)n.push(e);return n}function qo(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function D1(e,n,r,s,d,h){var x=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var _=e.entanglements,z=e.expirationTimes,Y=e.hiddenUpdates;for(r=x&~r;0<r;){var ne=31-Pt(r),oe=1<<ne;_[ne]=0,z[ne]=-1;var X=Y[ne];if(X!==null)for(Y[ne]=null,ne=0;ne<X.length;ne++){var J=X[ne];J!==null&&(J.lane&=-536870913)}r&=~oe}s!==0&&op(e,s,0),h!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=h&~(x&~n))}function op(e,n,r){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-Pt(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|r&261930}function sp(e,n){var r=e.entangledLanes|=n;for(e=e.entanglements;r;){var s=31-Pt(r),d=1<<s;d&n|e[s]&n&&(e[s]|=n),r&=~d}}function ip(e,n){var r=n&-n;return r=(r&42)!==0?1:Bc(r),(r&(e.suspendedLanes|n))!==0?0:r}function Bc(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 Uc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function lp(){var e=P.p;return e!==0?e:(e=window.event,e===void 0?32:$v(e.type))}function cp(e,n){var r=P.p;try{return P.p=e,n()}finally{P.p=r}}var ha=Math.random().toString(36).slice(2),pt="__reactFiber$"+ha,At="__reactProps$"+ha,jr="__reactContainer$"+ha,Wc="__reactEvents$"+ha,M1="__reactListeners$"+ha,L1="__reactHandles$"+ha,up="__reactResources$"+ha,Po="__reactMarker$"+ha;function Ic(e){delete e[pt],delete e[At],delete e[Wc],delete e[M1],delete e[L1]}function _r(e){var n=e[pt];if(n)return n;for(var r=e.parentNode;r;){if(n=r[jr]||r[pt]){if(r=n.alternate,n.child!==null||r!==null&&r.child!==null)for(e=Rv(e);e!==null;){if(r=e[pt])return r;e=Rv(e)}return n}e=r,r=e.parentNode}return null}function Ar(e){if(e=e[pt]||e[jr]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function Fo(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(i(33))}function Rr(e){var n=e[up];return n||(n=e[up]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function ft(e){e[Po]=!0}var dp=new Set,fp={};function tr(e,n){Or(e,n),Or(e+"Capture",n)}function Or(e,n){for(fp[e]=n,e=0;e<n.length;e++)dp.add(n[e])}var z1=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]*$"),mp={},pp={};function H1(e){return jn.call(pp,e)?!0:jn.call(mp,e)?!1:z1.test(e)?pp[e]=!0:(mp[e]=!0,!1)}function hi(e,n,r){if(H1(n))if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var s=n.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+r)}}function gi(e,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+r)}}function qn(e,n,r,s){if(s===null)e.removeAttribute(r);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(n,r,""+s)}}function on(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function hp(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function B1(e,n,r){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var d=s.get,h=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return d.call(this)},set:function(x){r=""+x,h.call(this,x)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return r},setValue:function(x){r=""+x},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function qc(e){if(!e._valueTracker){var n=hp(e)?"checked":"value";e._valueTracker=B1(e,n,""+e[n])}}function gp(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var r=n.getValue(),s="";return e&&(s=hp(e)?e.checked?"true":"false":e.value),e=s,e!==r?(n.setValue(e),!0):!1}function vi(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 U1=/[\n"\\]/g;function sn(e){return e.replace(U1,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Pc(e,n,r,s,d,h,x,_){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),n!=null?x==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+on(n)):e.value!==""+on(n)&&(e.value=""+on(n)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),n!=null?Fc(e,x,on(n)):r!=null?Fc(e,x,on(r)):s!=null&&e.removeAttribute("value"),d==null&&h!=null&&(e.defaultChecked=!!h),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.name=""+on(_):e.removeAttribute("name")}function vp(e,n,r,s,d,h,x,_){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),n!=null||r!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){qc(e);return}r=r!=null?""+on(r):"",n=n!=null?""+on(n):r,_||n===e.value||(e.value=n),e.defaultValue=n}s=s??d,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=_?e.checked:!!s,e.defaultChecked=!!s,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),qc(e)}function Fc(e,n,r){n==="number"&&vi(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function Dr(e,n,r,s){if(e=e.options,n){n={};for(var d=0;d<r.length;d++)n["$"+r[d]]=!0;for(r=0;r<e.length;r++)d=n.hasOwnProperty("$"+e[r].value),e[r].selected!==d&&(e[r].selected=d),d&&s&&(e[r].defaultSelected=!0)}else{for(r=""+on(r),n=null,d=0;d<e.length;d++){if(e[d].value===r){e[d].selected=!0,s&&(e[d].defaultSelected=!0);return}n!==null||e[d].disabled||(n=e[d])}n!==null&&(n.selected=!0)}}function yp(e,n,r){if(n!=null&&(n=""+on(n),n!==e.value&&(e.value=n),r==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=r!=null?""+on(r):""}function bp(e,n,r,s){if(n==null){if(s!=null){if(r!=null)throw Error(i(92));if(V(s)){if(1<s.length)throw Error(i(93));s=s[0]}r=s}r==null&&(r=""),n=r}r=on(n),e.defaultValue=r,s=e.textContent,s===r&&s!==""&&s!==null&&(e.value=s),qc(e)}function Mr(e,n){if(n){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=n;return}}e.textContent=n}var W1=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 wp(e,n,r){var s=n.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?s?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":s?e.setProperty(n,r):typeof r!="number"||r===0||W1.has(n)?n==="float"?e.cssFloat=r:e[n]=(""+r).trim():e[n]=r+"px"}function xp(e,n,r){if(n!=null&&typeof n!="object")throw Error(i(62));if(e=e.style,r!=null){for(var s in r)!r.hasOwnProperty(s)||n!=null&&n.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var d in n)s=n[d],n.hasOwnProperty(d)&&r[d]!==s&&wp(e,d,s)}else for(var h in n)n.hasOwnProperty(h)&&wp(e,h,n[h])}function Kc(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 I1=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"]]),q1=/^[\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 yi(e){return q1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Pn(){}var Yc=null;function $c(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Lr=null,zr=null;function kp(e){var n=Ar(e);if(n&&(e=n.stateNode)){var r=e[At]||null;e:switch(e=n.stateNode,n.type){case"input":if(Pc(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),n=r.name,r.type==="radio"&&n!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+sn(""+n)+'"][type="radio"]'),n=0;n<r.length;n++){var s=r[n];if(s!==e&&s.form===e.form){var d=s[At]||null;if(!d)throw Error(i(90));Pc(s,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(n=0;n<r.length;n++)s=r[n],s.form===e.form&&gp(s)}break e;case"textarea":yp(e,r.value,r.defaultValue);break e;case"select":n=r.value,n!=null&&Dr(e,!!r.multiple,n,!1)}}}var Vc=!1;function Sp(e,n,r){if(Vc)return e(n,r);Vc=!0;try{var s=e(n);return s}finally{if(Vc=!1,(Lr!==null||zr!==null)&&(ol(),Lr&&(n=Lr,e=zr,zr=Lr=null,kp(n),e)))for(n=0;n<e.length;n++)kp(e[n])}}function Ko(e,n){var r=e.stateNode;if(r===null)return null;var s=r[At]||null;if(s===null)return null;r=s[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(i(231,n,typeof r));return r}var Fn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gc=!1;if(Fn)try{var Yo={};Object.defineProperty(Yo,"passive",{get:function(){Gc=!0}}),window.addEventListener("test",Yo,Yo),window.removeEventListener("test",Yo,Yo)}catch{Gc=!1}var ga=null,Xc=null,bi=null;function Ep(){if(bi)return bi;var e,n=Xc,r=n.length,s,d="value"in ga?ga.value:ga.textContent,h=d.length;for(e=0;e<r&&n[e]===d[e];e++);var x=r-e;for(s=1;s<=x&&n[r-s]===d[h-s];s++);return bi=d.slice(e,1<s?1-s:void 0)}function wi(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function xi(){return!0}function Cp(){return!1}function Rt(e){function n(r,s,d,h,x){this._reactName=r,this._targetInst=d,this.type=s,this.nativeEvent=h,this.target=x,this.currentTarget=null;for(var _ in e)e.hasOwnProperty(_)&&(r=e[_],this[_]=r?r(h):h[_]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?xi:Cp,this.isPropagationStopped=Cp,this}return v(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=xi)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=xi)},persist:function(){},isPersistent:xi}),n}var nr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ki=Rt(nr),$o=v({},nr,{view:0,detail:0}),P1=Rt($o),Zc,Qc,Vo,Si=v({},$o,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:eu,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!==Vo&&(Vo&&e.type==="mousemove"?(Zc=e.screenX-Vo.screenX,Qc=e.screenY-Vo.screenY):Qc=Zc=0,Vo=e),Zc)},movementY:function(e){return"movementY"in e?e.movementY:Qc}}),Tp=Rt(Si),F1=v({},Si,{dataTransfer:0}),K1=Rt(F1),Y1=v({},$o,{relatedTarget:0}),Jc=Rt(Y1),$1=v({},nr,{animationName:0,elapsedTime:0,pseudoElement:0}),V1=Rt($1),G1=v({},nr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),X1=Rt(G1),Z1=v({},nr,{data:0}),Np=Rt(Z1),Q1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},J1={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"},ek={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tk(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=ek[e])?!!n[e]:!1}function eu(){return tk}var nk=v({},$o,{key:function(e){if(e.key){var n=Q1[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=wi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?J1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:eu,charCode:function(e){return e.type==="keypress"?wi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?wi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ak=Rt(nk),rk=v({},Si,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jp=Rt(rk),ok=v({},$o,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:eu}),sk=Rt(ok),ik=v({},nr,{propertyName:0,elapsedTime:0,pseudoElement:0}),lk=Rt(ik),ck=v({},Si,{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}),uk=Rt(ck),dk=v({},nr,{newState:0,oldState:0}),fk=Rt(dk),mk=[9,13,27,32],tu=Fn&&"CompositionEvent"in window,Go=null;Fn&&"documentMode"in document&&(Go=document.documentMode);var pk=Fn&&"TextEvent"in window&&!Go,_p=Fn&&(!tu||Go&&8<Go&&11>=Go),Ap=" ",Rp=!1;function Op(e,n){switch(e){case"keyup":return mk.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Dp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Hr=!1;function hk(e,n){switch(e){case"compositionend":return Dp(n);case"keypress":return n.which!==32?null:(Rp=!0,Ap);case"textInput":return e=n.data,e===Ap&&Rp?null:e;default:return null}}function gk(e,n){if(Hr)return e==="compositionend"||!tu&&Op(e,n)?(e=Ep(),bi=Xc=ga=null,Hr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return _p&&n.locale!=="ko"?null:n.data;default:return null}}var vk={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 Mp(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!vk[e.type]:n==="textarea"}function Lp(e,n,r,s){Lr?zr?zr.push(s):zr=[s]:Lr=s,n=fl(n,"onChange"),0<n.length&&(r=new ki("onChange","change",null,r,s),e.push({event:r,listeners:n}))}var Xo=null,Zo=null;function yk(e){vv(e,0)}function Ei(e){var n=Fo(e);if(gp(n))return e}function zp(e,n){if(e==="change")return n}var Hp=!1;if(Fn){var nu;if(Fn){var au="oninput"in document;if(!au){var Bp=document.createElement("div");Bp.setAttribute("oninput","return;"),au=typeof Bp.oninput=="function"}nu=au}else nu=!1;Hp=nu&&(!document.documentMode||9<document.documentMode)}function Up(){Xo&&(Xo.detachEvent("onpropertychange",Wp),Zo=Xo=null)}function Wp(e){if(e.propertyName==="value"&&Ei(Zo)){var n=[];Lp(n,Zo,e,$c(e)),Sp(yk,n)}}function bk(e,n,r){e==="focusin"?(Up(),Xo=n,Zo=r,Xo.attachEvent("onpropertychange",Wp)):e==="focusout"&&Up()}function wk(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ei(Zo)}function xk(e,n){if(e==="click")return Ei(n)}function kk(e,n){if(e==="input"||e==="change")return Ei(n)}function Sk(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Ft=typeof Object.is=="function"?Object.is:Sk;function Qo(e,n){if(Ft(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var r=Object.keys(e),s=Object.keys(n);if(r.length!==s.length)return!1;for(s=0;s<r.length;s++){var d=r[s];if(!jn.call(n,d)||!Ft(e[d],n[d]))return!1}return!0}function Ip(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function qp(e,n){var r=Ip(e);e=0;for(var s;r;){if(r.nodeType===3){if(s=e+r.textContent.length,e<=n&&s>=n)return{node:r,offset:n-e};e=s}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ip(r)}}function Pp(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Pp(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Fp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=vi(e.document);n instanceof e.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)e=n.contentWindow;else break;n=vi(e.document)}return n}function ru(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var Ek=Fn&&"documentMode"in document&&11>=document.documentMode,Br=null,ou=null,Jo=null,su=!1;function Kp(e,n,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;su||Br==null||Br!==vi(s)||(s=Br,"selectionStart"in s&&ru(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Jo&&Qo(Jo,s)||(Jo=s,s=fl(ou,"onSelect"),0<s.length&&(n=new ki("onSelect","select",null,n,r),e.push({event:n,listeners:s}),n.target=Br)))}function ar(e,n){var r={};return r[e.toLowerCase()]=n.toLowerCase(),r["Webkit"+e]="webkit"+n,r["Moz"+e]="moz"+n,r}var Ur={animationend:ar("Animation","AnimationEnd"),animationiteration:ar("Animation","AnimationIteration"),animationstart:ar("Animation","AnimationStart"),transitionrun:ar("Transition","TransitionRun"),transitionstart:ar("Transition","TransitionStart"),transitioncancel:ar("Transition","TransitionCancel"),transitionend:ar("Transition","TransitionEnd")},iu={},Yp={};Fn&&(Yp=document.createElement("div").style,"AnimationEvent"in window||(delete Ur.animationend.animation,delete Ur.animationiteration.animation,delete Ur.animationstart.animation),"TransitionEvent"in window||delete Ur.transitionend.transition);function rr(e){if(iu[e])return iu[e];if(!Ur[e])return e;var n=Ur[e],r;for(r in n)if(n.hasOwnProperty(r)&&r in Yp)return iu[e]=n[r];return e}var $p=rr("animationend"),Vp=rr("animationiteration"),Gp=rr("animationstart"),Ck=rr("transitionrun"),Tk=rr("transitionstart"),Nk=rr("transitioncancel"),Xp=rr("transitionend"),Zp=new Map,lu="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(" ");lu.push("scrollEnd");function yn(e,n){Zp.set(e,n),tr(n,[e])}var Ci=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=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(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ln=[],Wr=0,cu=0;function Ti(){for(var e=Wr,n=cu=Wr=0;n<e;){var r=ln[n];ln[n++]=null;var s=ln[n];ln[n++]=null;var d=ln[n];ln[n++]=null;var h=ln[n];if(ln[n++]=null,s!==null&&d!==null){var x=s.pending;x===null?d.next=d:(d.next=x.next,x.next=d),s.pending=d}h!==0&&Qp(r,d,h)}}function Ni(e,n,r,s){ln[Wr++]=e,ln[Wr++]=n,ln[Wr++]=r,ln[Wr++]=s,cu|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function uu(e,n,r,s){return Ni(e,n,r,s),ji(e)}function or(e,n){return Ni(e,null,null,n),ji(e)}function Qp(e,n,r){e.lanes|=r;var s=e.alternate;s!==null&&(s.lanes|=r);for(var d=!1,h=e.return;h!==null;)h.childLanes|=r,s=h.alternate,s!==null&&(s.childLanes|=r),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(d=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,d&&n!==null&&(d=31-Pt(r),e=h.hiddenUpdates,s=e[d],s===null?e[d]=[n]:s.push(n),n.lane=r|536870912),h):null}function ji(e){if(50<xs)throw xs=0,bd=null,Error(i(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Ir={};function jk(e,n,r,s){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kt(e,n,r,s){return new jk(e,n,r,s)}function du(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Kn(e,n){var r=e.alternate;return r===null?(r=Kt(e.tag,n,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=n,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,n=e.dependencies,r.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function Jp(e,n){e.flags&=65011714;var r=e.alternate;return r===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,n=r.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function _i(e,n,r,s,d,h){var x=0;if(s=e,typeof e=="function")du(e)&&(x=1);else if(typeof e=="string")x=D2(e,r,te.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case $:return e=Kt(31,r,n,d),e.elementType=$,e.lanes=h,e;case w:return sr(r.children,d,h,n);case C:x=8,d|=24;break;case T:return e=Kt(12,r,n,d|2),e.elementType=T,e.lanes=h,e;case O:return e=Kt(13,r,n,d),e.elementType=O,e.lanes=h,e;case D:return e=Kt(19,r,n,d),e.elementType=D,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:x=10;break e;case N:x=9;break e;case j:x=11;break e;case L:x=14;break e;case q:x=16,s=null;break e}x=29,r=Error(i(130,e===null?"null":typeof e,"")),s=null}return n=Kt(x,r,n,d),n.elementType=e,n.type=s,n.lanes=h,n}function sr(e,n,r,s){return e=Kt(7,e,s,n),e.lanes=r,e}function fu(e,n,r){return e=Kt(6,e,null,n),e.lanes=r,e}function eh(e){var n=Kt(18,null,null,0);return n.stateNode=e,n}function mu(e,n,r){return n=Kt(4,e.children!==null?e.children:[],e.key,n),n.lanes=r,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var th=new WeakMap;function cn(e,n){if(typeof e=="object"&&e!==null){var r=th.get(e);return r!==void 0?r:(n={value:e,source:n,stack:an(n)},th.set(e,n),n)}return{value:e,source:n,stack:an(n)}}var qr=[],Pr=0,Ai=null,es=0,un=[],dn=0,va=null,_n=1,An="";function Yn(e,n){qr[Pr++]=es,qr[Pr++]=Ai,Ai=e,es=n}function nh(e,n,r){un[dn++]=_n,un[dn++]=An,un[dn++]=va,va=e;var s=_n;e=An;var d=32-Pt(s)-1;s&=~(1<<d),r+=1;var h=32-Pt(n)+d;if(30<h){var x=d-d%5;h=(s&(1<<x)-1).toString(32),s>>=x,d-=x,_n=1<<32-Pt(n)+d|r<<d|s,An=h+e}else _n=1<<h|r<<d|s,An=e}function pu(e){e.return!==null&&(Yn(e,1),nh(e,1,0))}function hu(e){for(;e===Ai;)Ai=qr[--Pr],qr[Pr]=null,es=qr[--Pr],qr[Pr]=null;for(;e===va;)va=un[--dn],un[dn]=null,An=un[--dn],un[dn]=null,_n=un[--dn],un[dn]=null}function ah(e,n){un[dn++]=_n,un[dn++]=An,un[dn++]=va,_n=n.id,An=n.overflow,va=e}var ht=null,Xe=null,Be=!1,ya=null,fn=!1,gu=Error(i(519));function ba(e){var n=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ts(cn(n,e)),gu}function rh(e){var n=e.stateNode,r=e.type,s=e.memoizedProps;switch(n[pt]=e,n[At]=s,r){case"dialog":Le("cancel",n),Le("close",n);break;case"iframe":case"object":case"embed":Le("load",n);break;case"video":case"audio":for(r=0;r<Ss.length;r++)Le(Ss[r],n);break;case"source":Le("error",n);break;case"img":case"image":case"link":Le("error",n),Le("load",n);break;case"details":Le("toggle",n);break;case"input":Le("invalid",n),vp(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Le("invalid",n);break;case"textarea":Le("invalid",n),bp(n,s.value,s.defaultValue,s.children)}r=s.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||n.textContent===""+r||s.suppressHydrationWarning===!0||xv(n.textContent,r)?(s.popover!=null&&(Le("beforetoggle",n),Le("toggle",n)),s.onScroll!=null&&Le("scroll",n),s.onScrollEnd!=null&&Le("scrollend",n),s.onClick!=null&&(n.onclick=Pn),n=!0):n=!1,n||ba(e,!0)}function oh(e){for(ht=e.return;ht;)switch(ht.tag){case 5:case 31:case 13:fn=!1;return;case 27:case 3:fn=!0;return;default:ht=ht.return}}function Fr(e){if(e!==ht)return!1;if(!Be)return oh(e),Be=!0,!1;var n=e.tag,r;if((r=n!==3&&n!==27)&&((r=n===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Md(e.type,e.memoizedProps)),r=!r),r&&Xe&&ba(e),oh(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Xe=Av(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Xe=Av(e)}else n===27?(n=Xe,Da(e.type)?(e=Ud,Ud=null,Xe=e):Xe=n):Xe=ht?pn(e.stateNode.nextSibling):null;return!0}function ir(){Xe=ht=null,Be=!1}function vu(){var e=ya;return e!==null&&(Lt===null?Lt=e:Lt.push.apply(Lt,e),ya=null),e}function ts(e){ya===null?ya=[e]:ya.push(e)}var yu=R(null),lr=null,$n=null;function wa(e,n,r){se(yu,n._currentValue),n._currentValue=r}function Vn(e){e._currentValue=yu.current,B(yu)}function bu(e,n,r){for(;e!==null;){var s=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,s!==null&&(s.childLanes|=n)):s!==null&&(s.childLanes&n)!==n&&(s.childLanes|=n),e===r)break;e=e.return}}function wu(e,n,r,s){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var h=d.dependencies;if(h!==null){var x=d.child;h=h.firstContext;e:for(;h!==null;){var _=h;h=d;for(var z=0;z<n.length;z++)if(_.context===n[z]){h.lanes|=r,_=h.alternate,_!==null&&(_.lanes|=r),bu(h.return,r,e),s||(x=null);break e}h=_.next}}else if(d.tag===18){if(x=d.return,x===null)throw Error(i(341));x.lanes|=r,h=x.alternate,h!==null&&(h.lanes|=r),bu(x,r,e),x=null}else x=d.child;if(x!==null)x.return=d;else for(x=d;x!==null;){if(x===e){x=null;break}if(d=x.sibling,d!==null){d.return=x.return,x=d;break}x=x.return}d=x}}function Kr(e,n,r,s){e=null;for(var d=n,h=!1;d!==null;){if(!h){if((d.flags&524288)!==0)h=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var x=d.alternate;if(x===null)throw Error(i(387));if(x=x.memoizedProps,x!==null){var _=d.type;Ft(d.pendingProps.value,x.value)||(e!==null?e.push(_):e=[_])}}else if(d===ue.current){if(x=d.alternate,x===null)throw Error(i(387));x.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(js):e=[js])}d=d.return}e!==null&&wu(n,e,r,s),n.flags|=262144}function Ri(e){for(e=e.firstContext;e!==null;){if(!Ft(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function cr(e){lr=e,$n=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function gt(e){return sh(lr,e)}function Oi(e,n){return lr===null&&cr(e),sh(e,n)}function sh(e,n){var r=n._currentValue;if(n={context:n,memoizedValue:r,next:null},$n===null){if(e===null)throw Error(i(308));$n=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else $n=$n.next=n;return r}var _k=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(r,s){e.push(s)}};this.abort=function(){n.aborted=!0,e.forEach(function(r){return r()})}},Ak=t.unstable_scheduleCallback,Rk=t.unstable_NormalPriority,it={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function xu(){return{controller:new _k,data:new Map,refCount:0}}function ns(e){e.refCount--,e.refCount===0&&Ak(Rk,function(){e.controller.abort()})}var as=null,ku=0,Yr=0,$r=null;function Ok(e,n){if(as===null){var r=as=[];ku=0,Yr=Cd(),$r={status:"pending",value:void 0,then:function(s){r.push(s)}}}return ku++,n.then(ih,ih),n}function ih(){if(--ku===0&&as!==null){$r!==null&&($r.status="fulfilled");var e=as;as=null,Yr=0,$r=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function Dk(e,n){var r=[],s={status:"pending",value:null,reason:null,then:function(d){r.push(d)}};return e.then(function(){s.status="fulfilled",s.value=n;for(var d=0;d<r.length;d++)(0,r[d])(n)},function(d){for(s.status="rejected",s.reason=d,d=0;d<r.length;d++)(0,r[d])(void 0)}),s}var lh=M.S;M.S=function(e,n){Kg=we(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Ok(e,n),lh!==null&&lh(e,n)};var ur=R(null);function Su(){var e=ur.current;return e!==null?e:Ve.pooledCache}function Di(e,n){n===null?se(ur,ur.current):se(ur,n.pool)}function ch(){var e=Su();return e===null?null:{parent:it._currentValue,pool:e}}var Vr=Error(i(460)),Eu=Error(i(474)),Mi=Error(i(542)),Li={then:function(){}};function uh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function dh(e,n,r){switch(r=e[r],r===void 0?e.push(n):r!==n&&(n.then(Pn,Pn),n=r),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,mh(e),e;default:if(typeof n.status=="string")n.then(Pn,Pn);else{if(e=Ve,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=n,e.status="pending",e.then(function(s){if(n.status==="pending"){var d=n;d.status="fulfilled",d.value=s}},function(s){if(n.status==="pending"){var d=n;d.status="rejected",d.reason=s}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,mh(e),e}throw fr=n,Vr}}function dr(e){try{var n=e._init;return n(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(fr=r,Vr):r}}var fr=null;function fh(){if(fr===null)throw Error(i(459));var e=fr;return fr=null,e}function mh(e){if(e===Vr||e===Mi)throw Error(i(483))}var Gr=null,rs=0;function zi(e){var n=rs;return rs+=1,Gr===null&&(Gr=[]),dh(Gr,e,n)}function os(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Hi(e,n){throw n.$$typeof===k?Error(i(525)):(e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function ph(e){function n(U,H){if(e){var K=U.deletions;K===null?(U.deletions=[H],U.flags|=16):K.push(H)}}function r(U,H){if(!e)return null;for(;H!==null;)n(U,H),H=H.sibling;return null}function s(U){for(var H=new Map;U!==null;)U.key!==null?H.set(U.key,U):H.set(U.index,U),U=U.sibling;return H}function d(U,H){return U=Kn(U,H),U.index=0,U.sibling=null,U}function h(U,H,K){return U.index=K,e?(K=U.alternate,K!==null?(K=K.index,K<H?(U.flags|=67108866,H):K):(U.flags|=67108866,H)):(U.flags|=1048576,H)}function x(U){return e&&U.alternate===null&&(U.flags|=67108866),U}function _(U,H,K,re){return H===null||H.tag!==6?(H=fu(K,U.mode,re),H.return=U,H):(H=d(H,K),H.return=U,H)}function z(U,H,K,re){var Ee=K.type;return Ee===w?ne(U,H,K.props.children,re,K.key):H!==null&&(H.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===q&&dr(Ee)===H.type)?(H=d(H,K.props),os(H,K),H.return=U,H):(H=_i(K.type,K.key,K.props,null,U.mode,re),os(H,K),H.return=U,H)}function Y(U,H,K,re){return H===null||H.tag!==4||H.stateNode.containerInfo!==K.containerInfo||H.stateNode.implementation!==K.implementation?(H=mu(K,U.mode,re),H.return=U,H):(H=d(H,K.children||[]),H.return=U,H)}function ne(U,H,K,re,Ee){return H===null||H.tag!==7?(H=sr(K,U.mode,re,Ee),H.return=U,H):(H=d(H,K),H.return=U,H)}function oe(U,H,K){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=fu(""+H,U.mode,K),H.return=U,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case S:return K=_i(H.type,H.key,H.props,null,U.mode,K),os(K,H),K.return=U,K;case E:return H=mu(H,U.mode,K),H.return=U,H;case q:return H=dr(H),oe(U,H,K)}if(V(H)||W(H))return H=sr(H,U.mode,K,null),H.return=U,H;if(typeof H.then=="function")return oe(U,zi(H),K);if(H.$$typeof===A)return oe(U,Oi(U,H),K);Hi(U,H)}return null}function X(U,H,K,re){var Ee=H!==null?H.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return Ee!==null?null:_(U,H,""+K,re);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case S:return K.key===Ee?z(U,H,K,re):null;case E:return K.key===Ee?Y(U,H,K,re):null;case q:return K=dr(K),X(U,H,K,re)}if(V(K)||W(K))return Ee!==null?null:ne(U,H,K,re,null);if(typeof K.then=="function")return X(U,H,zi(K),re);if(K.$$typeof===A)return X(U,H,Oi(U,K),re);Hi(U,K)}return null}function J(U,H,K,re,Ee){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return U=U.get(K)||null,_(H,U,""+re,Ee);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case S:return U=U.get(re.key===null?K:re.key)||null,z(H,U,re,Ee);case E:return U=U.get(re.key===null?K:re.key)||null,Y(H,U,re,Ee);case q:return re=dr(re),J(U,H,K,re,Ee)}if(V(re)||W(re))return U=U.get(K)||null,ne(H,U,re,Ee,null);if(typeof re.then=="function")return J(U,H,K,zi(re),Ee);if(re.$$typeof===A)return J(U,H,K,Oi(H,re),Ee);Hi(H,re)}return null}function he(U,H,K,re){for(var Ee=null,Ue=null,be=H,Ae=H=0,He=null;be!==null&&Ae<K.length;Ae++){be.index>Ae?(He=be,be=null):He=be.sibling;var We=X(U,be,K[Ae],re);if(We===null){be===null&&(be=He);break}e&&be&&We.alternate===null&&n(U,be),H=h(We,H,Ae),Ue===null?Ee=We:Ue.sibling=We,Ue=We,be=He}if(Ae===K.length)return r(U,be),Be&&Yn(U,Ae),Ee;if(be===null){for(;Ae<K.length;Ae++)be=oe(U,K[Ae],re),be!==null&&(H=h(be,H,Ae),Ue===null?Ee=be:Ue.sibling=be,Ue=be);return Be&&Yn(U,Ae),Ee}for(be=s(be);Ae<K.length;Ae++)He=J(be,U,Ae,K[Ae],re),He!==null&&(e&&He.alternate!==null&&be.delete(He.key===null?Ae:He.key),H=h(He,H,Ae),Ue===null?Ee=He:Ue.sibling=He,Ue=He);return e&&be.forEach(function(Ba){return n(U,Ba)}),Be&&Yn(U,Ae),Ee}function Ce(U,H,K,re){if(K==null)throw Error(i(151));for(var Ee=null,Ue=null,be=H,Ae=H=0,He=null,We=K.next();be!==null&&!We.done;Ae++,We=K.next()){be.index>Ae?(He=be,be=null):He=be.sibling;var Ba=X(U,be,We.value,re);if(Ba===null){be===null&&(be=He);break}e&&be&&Ba.alternate===null&&n(U,be),H=h(Ba,H,Ae),Ue===null?Ee=Ba:Ue.sibling=Ba,Ue=Ba,be=He}if(We.done)return r(U,be),Be&&Yn(U,Ae),Ee;if(be===null){for(;!We.done;Ae++,We=K.next())We=oe(U,We.value,re),We!==null&&(H=h(We,H,Ae),Ue===null?Ee=We:Ue.sibling=We,Ue=We);return Be&&Yn(U,Ae),Ee}for(be=s(be);!We.done;Ae++,We=K.next())We=J(be,U,Ae,We.value,re),We!==null&&(e&&We.alternate!==null&&be.delete(We.key===null?Ae:We.key),H=h(We,H,Ae),Ue===null?Ee=We:Ue.sibling=We,Ue=We);return e&&be.forEach(function(F2){return n(U,F2)}),Be&&Yn(U,Ae),Ee}function $e(U,H,K,re){if(typeof K=="object"&&K!==null&&K.type===w&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case S:e:{for(var Ee=K.key;H!==null;){if(H.key===Ee){if(Ee=K.type,Ee===w){if(H.tag===7){r(U,H.sibling),re=d(H,K.props.children),re.return=U,U=re;break e}}else if(H.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===q&&dr(Ee)===H.type){r(U,H.sibling),re=d(H,K.props),os(re,K),re.return=U,U=re;break e}r(U,H);break}else n(U,H);H=H.sibling}K.type===w?(re=sr(K.props.children,U.mode,re,K.key),re.return=U,U=re):(re=_i(K.type,K.key,K.props,null,U.mode,re),os(re,K),re.return=U,U=re)}return x(U);case E:e:{for(Ee=K.key;H!==null;){if(H.key===Ee)if(H.tag===4&&H.stateNode.containerInfo===K.containerInfo&&H.stateNode.implementation===K.implementation){r(U,H.sibling),re=d(H,K.children||[]),re.return=U,U=re;break e}else{r(U,H);break}else n(U,H);H=H.sibling}re=mu(K,U.mode,re),re.return=U,U=re}return x(U);case q:return K=dr(K),$e(U,H,K,re)}if(V(K))return he(U,H,K,re);if(W(K)){if(Ee=W(K),typeof Ee!="function")throw Error(i(150));return K=Ee.call(K),Ce(U,H,K,re)}if(typeof K.then=="function")return $e(U,H,zi(K),re);if(K.$$typeof===A)return $e(U,H,Oi(U,K),re);Hi(U,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,H!==null&&H.tag===6?(r(U,H.sibling),re=d(H,K),re.return=U,U=re):(r(U,H),re=fu(K,U.mode,re),re.return=U,U=re),x(U)):r(U,H)}return function(U,H,K,re){try{rs=0;var Ee=$e(U,H,K,re);return Gr=null,Ee}catch(be){if(be===Vr||be===Mi)throw be;var Ue=Kt(29,be,null,U.mode);return Ue.lanes=re,Ue.return=U,Ue}}}var mr=ph(!0),hh=ph(!1),xa=!1;function Cu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Tu(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Sa(e,n,r){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ie&2)!==0){var d=s.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),s.pending=n,n=ji(e),Qp(e,null,r),n}return Ni(e,s,n,r),ji(e)}function ss(e,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var s=n.lanes;s&=e.pendingLanes,r|=s,n.lanes=r,sp(e,r)}}function Nu(e,n){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var d=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var x={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};h===null?d=h=x:h=h.next=x,r=r.next}while(r!==null);h===null?d=h=n:h=h.next=n}else d=h=n;r={baseState:s.baseState,firstBaseUpdate:d,lastBaseUpdate:h,shared:s.shared,callbacks:s.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=n:e.next=n,r.lastBaseUpdate=n}var ju=!1;function is(){if(ju){var e=$r;if(e!==null)throw e}}function ls(e,n,r,s){ju=!1;var d=e.updateQueue;xa=!1;var h=d.firstBaseUpdate,x=d.lastBaseUpdate,_=d.shared.pending;if(_!==null){d.shared.pending=null;var z=_,Y=z.next;z.next=null,x===null?h=Y:x.next=Y,x=z;var ne=e.alternate;ne!==null&&(ne=ne.updateQueue,_=ne.lastBaseUpdate,_!==x&&(_===null?ne.firstBaseUpdate=Y:_.next=Y,ne.lastBaseUpdate=z))}if(h!==null){var oe=d.baseState;x=0,ne=Y=z=null,_=h;do{var X=_.lane&-536870913,J=X!==_.lane;if(J?(ze&X)===X:(s&X)===X){X!==0&&X===Yr&&(ju=!0),ne!==null&&(ne=ne.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var he=e,Ce=_;X=n;var $e=r;switch(Ce.tag){case 1:if(he=Ce.payload,typeof he=="function"){oe=he.call($e,oe,X);break e}oe=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=Ce.payload,X=typeof he=="function"?he.call($e,oe,X):he,X==null)break e;oe=v({},oe,X);break e;case 2:xa=!0}}X=_.callback,X!==null&&(e.flags|=64,J&&(e.flags|=8192),J=d.callbacks,J===null?d.callbacks=[X]:J.push(X))}else J={lane:X,tag:_.tag,payload:_.payload,callback:_.callback,next:null},ne===null?(Y=ne=J,z=oe):ne=ne.next=J,x|=X;if(_=_.next,_===null){if(_=d.shared.pending,_===null)break;J=_,_=J.next,J.next=null,d.lastBaseUpdate=J,d.shared.pending=null}}while(!0);ne===null&&(z=oe),d.baseState=z,d.firstBaseUpdate=Y,d.lastBaseUpdate=ne,h===null&&(d.shared.lanes=0),ja|=x,e.lanes=x,e.memoizedState=oe}}function gh(e,n){if(typeof e!="function")throw Error(i(191,e));e.call(n)}function vh(e,n){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)gh(r[e],n)}var Xr=R(null),Bi=R(0);function yh(e,n){e=aa,se(Bi,e),se(Xr,n),aa=e|n.baseLanes}function _u(){se(Bi,aa),se(Xr,Xr.current)}function Au(){aa=Bi.current,B(Xr),B(Bi)}var Yt=R(null),mn=null;function Ea(e){var n=e.alternate;se(rt,rt.current&1),se(Yt,e),mn===null&&(n===null||Xr.current!==null||n.memoizedState!==null)&&(mn=e)}function Ru(e){se(rt,rt.current),se(Yt,e),mn===null&&(mn=e)}function bh(e){e.tag===22?(se(rt,rt.current),se(Yt,e),mn===null&&(mn=e)):Ca()}function Ca(){se(rt,rt.current),se(Yt,Yt.current)}function $t(e){B(Yt),mn===e&&(mn=null),B(rt)}var rt=R(0);function Ui(e){for(var n=e;n!==null;){if(n.tag===13){var r=n.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Hd(r)||Bd(r)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Gn=0,_e=null,Ke=null,lt=null,Wi=!1,Zr=!1,pr=!1,Ii=0,cs=0,Qr=null,Mk=0;function tt(){throw Error(i(321))}function Ou(e,n){if(n===null)return!1;for(var r=0;r<n.length&&r<e.length;r++)if(!Ft(e[r],n[r]))return!1;return!0}function Du(e,n,r,s,d,h){return Gn=h,_e=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,M.H=e===null||e.memoizedState===null?ng:Vu,pr=!1,h=r(s,d),pr=!1,Zr&&(h=xh(n,r,s,d)),wh(e),h}function wh(e){M.H=fs;var n=Ke!==null&&Ke.next!==null;if(Gn=0,lt=Ke=_e=null,Wi=!1,cs=0,Qr=null,n)throw Error(i(300));e===null||ct||(e=e.dependencies,e!==null&&Ri(e)&&(ct=!0))}function xh(e,n,r,s){_e=e;var d=0;do{if(Zr&&(Qr=null),cs=0,Zr=!1,25<=d)throw Error(i(301));if(d+=1,lt=Ke=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}M.H=ag,h=n(r,s)}while(Zr);return h}function Lk(){var e=M.H,n=e.useState()[0];return n=typeof n.then=="function"?us(n):n,e=e.useState()[0],(Ke!==null?Ke.memoizedState:null)!==e&&(_e.flags|=1024),n}function Mu(){var e=Ii!==0;return Ii=0,e}function Lu(e,n,r){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~r}function zu(e){if(Wi){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Wi=!1}Gn=0,lt=Ke=_e=null,Zr=!1,cs=Ii=0,Qr=null}function Tt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lt===null?_e.memoizedState=lt=e:lt=lt.next=e,lt}function ot(){if(Ke===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=Ke.next;var n=lt===null?_e.memoizedState:lt.next;if(n!==null)lt=n,Ke=e;else{if(e===null)throw _e.alternate===null?Error(i(467)):Error(i(310));Ke=e,e={memoizedState:Ke.memoizedState,baseState:Ke.baseState,baseQueue:Ke.baseQueue,queue:Ke.queue,next:null},lt===null?_e.memoizedState=lt=e:lt=lt.next=e}return lt}function qi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function us(e){var n=cs;return cs+=1,Qr===null&&(Qr=[]),e=dh(Qr,e,n),n=_e,(lt===null?n.memoizedState:lt.next)===null&&(n=n.alternate,M.H=n===null||n.memoizedState===null?ng:Vu),e}function Pi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return us(e);if(e.$$typeof===A)return gt(e)}throw Error(i(438,String(e)))}function Hu(e){var n=null,r=_e.updateQueue;if(r!==null&&(n=r.memoCache),n==null){var s=_e.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(n={data:s.data.map(function(d){return d.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),r===null&&(r=qi(),_e.updateQueue=r),r.memoCache=n,r=n.data[n.index],r===void 0)for(r=n.data[n.index]=Array(e),s=0;s<e;s++)r[s]=ae;return n.index++,r}function Xn(e,n){return typeof n=="function"?n(e):n}function Fi(e){var n=ot();return Bu(n,Ke,e)}function Bu(e,n,r){var s=e.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=r;var d=e.baseQueue,h=s.pending;if(h!==null){if(d!==null){var x=d.next;d.next=h.next,h.next=x}n.baseQueue=d=h,s.pending=null}if(h=e.baseState,d===null)e.memoizedState=h;else{n=d.next;var _=x=null,z=null,Y=n,ne=!1;do{var oe=Y.lane&-536870913;if(oe!==Y.lane?(ze&oe)===oe:(Gn&oe)===oe){var X=Y.revertLane;if(X===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),oe===Yr&&(ne=!0);else if((Gn&X)===X){Y=Y.next,X===Yr&&(ne=!0);continue}else oe={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},z===null?(_=z=oe,x=h):z=z.next=oe,_e.lanes|=X,ja|=X;oe=Y.action,pr&&r(h,oe),h=Y.hasEagerState?Y.eagerState:r(h,oe)}else X={lane:oe,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},z===null?(_=z=X,x=h):z=z.next=X,_e.lanes|=oe,ja|=oe;Y=Y.next}while(Y!==null&&Y!==n);if(z===null?x=h:z.next=_,!Ft(h,e.memoizedState)&&(ct=!0,ne&&(r=$r,r!==null)))throw r;e.memoizedState=h,e.baseState=x,e.baseQueue=z,s.lastRenderedState=h}return d===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Uu(e){var n=ot(),r=n.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=e;var s=r.dispatch,d=r.pending,h=n.memoizedState;if(d!==null){r.pending=null;var x=d=d.next;do h=e(h,x.action),x=x.next;while(x!==d);Ft(h,n.memoizedState)||(ct=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),r.lastRenderedState=h}return[h,s]}function kh(e,n,r){var s=_e,d=ot(),h=Be;if(h){if(r===void 0)throw Error(i(407));r=r()}else r=n();var x=!Ft((Ke||d).memoizedState,r);if(x&&(d.memoizedState=r,ct=!0),d=d.queue,qu(Ch.bind(null,s,d,e),[e]),d.getSnapshot!==n||x||lt!==null&<.memoizedState.tag&1){if(s.flags|=2048,Jr(9,{destroy:void 0},Eh.bind(null,s,d,r,n),null),Ve===null)throw Error(i(349));h||(Gn&127)!==0||Sh(s,n,r)}return r}function Sh(e,n,r){e.flags|=16384,e={getSnapshot:n,value:r},n=_e.updateQueue,n===null?(n=qi(),_e.updateQueue=n,n.stores=[e]):(r=n.stores,r===null?n.stores=[e]:r.push(e))}function Eh(e,n,r,s){n.value=r,n.getSnapshot=s,Th(n)&&Nh(e)}function Ch(e,n,r){return r(function(){Th(n)&&Nh(e)})}function Th(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!Ft(e,r)}catch{return!0}}function Nh(e){var n=or(e,2);n!==null&&zt(n,e,2)}function Wu(e){var n=Tt();if(typeof e=="function"){var r=e;if(e=r(),pr){pa(!0);try{r()}finally{pa(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xn,lastRenderedState:e},n}function jh(e,n,r,s){return e.baseState=r,Bu(e,Ke,typeof s=="function"?s:Xn)}function zk(e,n,r,s,d){if($i(e))throw Error(i(485));if(e=n.action,e!==null){var h={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){h.listeners.push(x)}};M.T!==null?r(!0):h.isTransition=!1,s(h),r=n.pending,r===null?(h.next=n.pending=h,_h(n,h)):(h.next=r.next,n.pending=r.next=h)}}function _h(e,n){var r=n.action,s=n.payload,d=e.state;if(n.isTransition){var h=M.T,x={};M.T=x;try{var _=r(d,s),z=M.S;z!==null&&z(x,_),Ah(e,n,_)}catch(Y){Iu(e,n,Y)}finally{h!==null&&x.types!==null&&(h.types=x.types),M.T=h}}else try{h=r(d,s),Ah(e,n,h)}catch(Y){Iu(e,n,Y)}}function Ah(e,n,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(s){Rh(e,n,s)},function(s){return Iu(e,n,s)}):Rh(e,n,r)}function Rh(e,n,r){n.status="fulfilled",n.value=r,Oh(n),e.state=r,n=e.pending,n!==null&&(r=n.next,r===n?e.pending=null:(r=r.next,n.next=r,_h(e,r)))}function Iu(e,n,r){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=r,Oh(n),n=n.next;while(n!==s)}e.action=null}function Oh(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function Dh(e,n){return n}function Mh(e,n){if(Be){var r=Ve.formState;if(r!==null){e:{var s=_e;if(Be){if(Xe){t:{for(var d=Xe,h=fn;d.nodeType!==8;){if(!h){d=null;break t}if(d=pn(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){Xe=pn(d.nextSibling),s=d.data==="F!";break e}}ba(s)}s=!1}s&&(n=r[0])}}return r=Tt(),r.memoizedState=r.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dh,lastRenderedState:n},r.queue=s,r=Jh.bind(null,_e,s),s.dispatch=r,s=Wu(!1),h=$u.bind(null,_e,!1,s.queue),s=Tt(),d={state:n,dispatch:null,action:e,pending:null},s.queue=d,r=zk.bind(null,_e,d,h,r),d.dispatch=r,s.memoizedState=e,[n,r,!1]}function Lh(e){var n=ot();return zh(n,Ke,e)}function zh(e,n,r){if(n=Bu(e,n,Dh)[0],e=Fi(Xn)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=us(n)}catch(x){throw x===Vr?Mi:x}else s=n;n=ot();var d=n.queue,h=d.dispatch;return r!==n.memoizedState&&(_e.flags|=2048,Jr(9,{destroy:void 0},Hk.bind(null,d,r),null)),[s,h,e]}function Hk(e,n){e.action=n}function Hh(e){var n=ot(),r=Ke;if(r!==null)return zh(n,r,e);ot(),n=n.memoizedState,r=ot();var s=r.queue.dispatch;return r.memoizedState=e,[n,s,!1]}function Jr(e,n,r,s){return e={tag:e,create:r,deps:s,inst:n,next:null},n=_e.updateQueue,n===null&&(n=qi(),_e.updateQueue=n),r=n.lastEffect,r===null?n.lastEffect=e.next=e:(s=r.next,r.next=e,e.next=s,n.lastEffect=e),e}function Bh(){return ot().memoizedState}function Ki(e,n,r,s){var d=Tt();_e.flags|=e,d.memoizedState=Jr(1|n,{destroy:void 0},r,s===void 0?null:s)}function Yi(e,n,r,s){var d=ot();s=s===void 0?null:s;var h=d.memoizedState.inst;Ke!==null&&s!==null&&Ou(s,Ke.memoizedState.deps)?d.memoizedState=Jr(n,h,r,s):(_e.flags|=e,d.memoizedState=Jr(1|n,h,r,s))}function Uh(e,n){Ki(8390656,8,e,n)}function qu(e,n){Yi(2048,8,e,n)}function Bk(e){_e.flags|=4;var n=_e.updateQueue;if(n===null)n=qi(),_e.updateQueue=n,n.events=[e];else{var r=n.events;r===null?n.events=[e]:r.push(e)}}function Wh(e){var n=ot().memoizedState;return Bk({ref:n,nextImpl:e}),function(){if((Ie&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}function Ih(e,n){return Yi(4,2,e,n)}function qh(e,n){return Yi(4,4,e,n)}function Ph(e,n){if(typeof n=="function"){e=e();var r=n(e);return function(){typeof r=="function"?r():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Fh(e,n,r){r=r!=null?r.concat([e]):null,Yi(4,4,Ph.bind(null,n,e),r)}function Pu(){}function Kh(e,n){var r=ot();n=n===void 0?null:n;var s=r.memoizedState;return n!==null&&Ou(n,s[1])?s[0]:(r.memoizedState=[e,n],e)}function Yh(e,n){var r=ot();n=n===void 0?null:n;var s=r.memoizedState;if(n!==null&&Ou(n,s[1]))return s[0];if(s=e(),pr){pa(!0);try{e()}finally{pa(!1)}}return r.memoizedState=[s,n],s}function Fu(e,n,r){return r===void 0||(Gn&1073741824)!==0&&(ze&261930)===0?e.memoizedState=n:(e.memoizedState=r,e=$g(),_e.lanes|=e,ja|=e,r)}function $h(e,n,r,s){return Ft(r,n)?r:Xr.current!==null?(e=Fu(e,r,s),Ft(e,n)||(ct=!0),e):(Gn&42)===0||(Gn&1073741824)!==0&&(ze&261930)===0?(ct=!0,e.memoizedState=r):(e=$g(),_e.lanes|=e,ja|=e,n)}function Vh(e,n,r,s,d){var h=P.p;P.p=h!==0&&8>h?h:8;var x=M.T,_={};M.T=_,$u(e,!1,n,r);try{var z=d(),Y=M.S;if(Y!==null&&Y(_,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var ne=Dk(z,s);ds(e,n,ne,Xt(e))}else ds(e,n,s,Xt(e))}catch(oe){ds(e,n,{then:function(){},status:"rejected",reason:oe},Xt())}finally{P.p=h,x!==null&&_.types!==null&&(x.types=_.types),M.T=x}}function Uk(){}function Ku(e,n,r,s){if(e.tag!==5)throw Error(i(476));var d=Gh(e).queue;Vh(e,d,n,I,r===null?Uk:function(){return Xh(e),r(s)})}function Gh(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xn,lastRenderedState:I},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xn,lastRenderedState:r},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Xh(e){var n=Gh(e);n.next===null&&(n=e.alternate.memoizedState),ds(e,n.next.queue,{},Xt())}function Yu(){return gt(js)}function Zh(){return ot().memoizedState}function Qh(){return ot().memoizedState}function Wk(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var r=Xt();e=ka(r);var s=Sa(n,e,r);s!==null&&(zt(s,n,r),ss(s,n,r)),n={cache:xu()},e.payload=n;return}n=n.return}}function Ik(e,n,r){var s=Xt();r={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},$i(e)?eg(n,r):(r=uu(e,n,r,s),r!==null&&(zt(r,e,s),tg(r,n,s)))}function Jh(e,n,r){var s=Xt();ds(e,n,r,s)}function ds(e,n,r,s){var d={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if($i(e))eg(n,d);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var x=n.lastRenderedState,_=h(x,r);if(d.hasEagerState=!0,d.eagerState=_,Ft(_,x))return Ni(e,n,d,0),Ve===null&&Ti(),!1}catch{}if(r=uu(e,n,d,s),r!==null)return zt(r,e,s),tg(r,n,s),!0}return!1}function $u(e,n,r,s){if(s={lane:2,revertLane:Cd(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},$i(e)){if(n)throw Error(i(479))}else n=uu(e,r,s,2),n!==null&&zt(n,e,2)}function $i(e){var n=e.alternate;return e===_e||n!==null&&n===_e}function eg(e,n){Zr=Wi=!0;var r=e.pending;r===null?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function tg(e,n,r){if((r&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,r|=s,n.lanes=r,sp(e,r)}}var fs={readContext:gt,use:Pi,useCallback:tt,useContext:tt,useEffect:tt,useImperativeHandle:tt,useLayoutEffect:tt,useInsertionEffect:tt,useMemo:tt,useReducer:tt,useRef:tt,useState:tt,useDebugValue:tt,useDeferredValue:tt,useTransition:tt,useSyncExternalStore:tt,useId:tt,useHostTransitionStatus:tt,useFormState:tt,useActionState:tt,useOptimistic:tt,useMemoCache:tt,useCacheRefresh:tt};fs.useEffectEvent=tt;var ng={readContext:gt,use:Pi,useCallback:function(e,n){return Tt().memoizedState=[e,n===void 0?null:n],e},useContext:gt,useEffect:Uh,useImperativeHandle:function(e,n,r){r=r!=null?r.concat([e]):null,Ki(4194308,4,Ph.bind(null,n,e),r)},useLayoutEffect:function(e,n){return Ki(4194308,4,e,n)},useInsertionEffect:function(e,n){Ki(4,2,e,n)},useMemo:function(e,n){var r=Tt();n=n===void 0?null:n;var s=e();if(pr){pa(!0);try{e()}finally{pa(!1)}}return r.memoizedState=[s,n],s},useReducer:function(e,n,r){var s=Tt();if(r!==void 0){var d=r(n);if(pr){pa(!0);try{r(n)}finally{pa(!1)}}}else d=n;return s.memoizedState=s.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},s.queue=e,e=e.dispatch=Ik.bind(null,_e,e),[s.memoizedState,e]},useRef:function(e){var n=Tt();return e={current:e},n.memoizedState=e},useState:function(e){e=Wu(e);var n=e.queue,r=Jh.bind(null,_e,n);return n.dispatch=r,[e.memoizedState,r]},useDebugValue:Pu,useDeferredValue:function(e,n){var r=Tt();return Fu(r,e,n)},useTransition:function(){var e=Wu(!1);return e=Vh.bind(null,_e,e.queue,!0,!1),Tt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,r){var s=_e,d=Tt();if(Be){if(r===void 0)throw Error(i(407));r=r()}else{if(r=n(),Ve===null)throw Error(i(349));(ze&127)!==0||Sh(s,n,r)}d.memoizedState=r;var h={value:r,getSnapshot:n};return d.queue=h,Uh(Ch.bind(null,s,h,e),[e]),s.flags|=2048,Jr(9,{destroy:void 0},Eh.bind(null,s,h,r,n),null),r},useId:function(){var e=Tt(),n=Ve.identifierPrefix;if(Be){var r=An,s=_n;r=(s&~(1<<32-Pt(s)-1)).toString(32)+r,n="_"+n+"R_"+r,r=Ii++,0<r&&(n+="H"+r.toString(32)),n+="_"}else r=Mk++,n="_"+n+"r_"+r.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Yu,useFormState:Mh,useActionState:Mh,useOptimistic:function(e){var n=Tt();n.memoizedState=n.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=r,n=$u.bind(null,_e,!0,r),r.dispatch=n,[e,n]},useMemoCache:Hu,useCacheRefresh:function(){return Tt().memoizedState=Wk.bind(null,_e)},useEffectEvent:function(e){var n=Tt(),r={impl:e};return n.memoizedState=r,function(){if((Ie&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}},Vu={readContext:gt,use:Pi,useCallback:Kh,useContext:gt,useEffect:qu,useImperativeHandle:Fh,useInsertionEffect:Ih,useLayoutEffect:qh,useMemo:Yh,useReducer:Fi,useRef:Bh,useState:function(){return Fi(Xn)},useDebugValue:Pu,useDeferredValue:function(e,n){var r=ot();return $h(r,Ke.memoizedState,e,n)},useTransition:function(){var e=Fi(Xn)[0],n=ot().memoizedState;return[typeof e=="boolean"?e:us(e),n]},useSyncExternalStore:kh,useId:Zh,useHostTransitionStatus:Yu,useFormState:Lh,useActionState:Lh,useOptimistic:function(e,n){var r=ot();return jh(r,Ke,e,n)},useMemoCache:Hu,useCacheRefresh:Qh};Vu.useEffectEvent=Wh;var ag={readContext:gt,use:Pi,useCallback:Kh,useContext:gt,useEffect:qu,useImperativeHandle:Fh,useInsertionEffect:Ih,useLayoutEffect:qh,useMemo:Yh,useReducer:Uu,useRef:Bh,useState:function(){return Uu(Xn)},useDebugValue:Pu,useDeferredValue:function(e,n){var r=ot();return Ke===null?Fu(r,e,n):$h(r,Ke.memoizedState,e,n)},useTransition:function(){var e=Uu(Xn)[0],n=ot().memoizedState;return[typeof e=="boolean"?e:us(e),n]},useSyncExternalStore:kh,useId:Zh,useHostTransitionStatus:Yu,useFormState:Hh,useActionState:Hh,useOptimistic:function(e,n){var r=ot();return Ke!==null?jh(r,Ke,e,n):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:Hu,useCacheRefresh:Qh};ag.useEffectEvent=Wh;function Gu(e,n,r,s){n=e.memoizedState,r=r(s,n),r=r==null?n:v({},n,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Xu={enqueueSetState:function(e,n,r){e=e._reactInternals;var s=Xt(),d=ka(s);d.payload=n,r!=null&&(d.callback=r),n=Sa(e,d,s),n!==null&&(zt(n,e,s),ss(n,e,s))},enqueueReplaceState:function(e,n,r){e=e._reactInternals;var s=Xt(),d=ka(s);d.tag=1,d.payload=n,r!=null&&(d.callback=r),n=Sa(e,d,s),n!==null&&(zt(n,e,s),ss(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var r=Xt(),s=ka(r);s.tag=2,n!=null&&(s.callback=n),n=Sa(e,s,r),n!==null&&(zt(n,e,r),ss(n,e,r))}};function rg(e,n,r,s,d,h,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,h,x):n.prototype&&n.prototype.isPureReactComponent?!Qo(r,s)||!Qo(d,h):!0}function og(e,n,r,s){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(r,s),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(r,s),n.state!==e&&Xu.enqueueReplaceState(n,n.state,null)}function hr(e,n){var r=n;if("ref"in n){r={};for(var s in n)s!=="ref"&&(r[s]=n[s])}if(e=e.defaultProps){r===n&&(r=v({},r));for(var d in e)r[d]===void 0&&(r[d]=e[d])}return r}function sg(e){Ci(e)}function ig(e){console.error(e)}function lg(e){Ci(e)}function Vi(e,n){try{var r=e.onUncaughtError;r(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function cg(e,n,r){try{var s=e.onCaughtError;s(r.value,{componentStack:r.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Zu(e,n,r){return r=ka(r),r.tag=3,r.payload={element:null},r.callback=function(){Vi(e,n)},r}function ug(e){return e=ka(e),e.tag=3,e}function dg(e,n,r,s){var d=r.type.getDerivedStateFromError;if(typeof d=="function"){var h=s.value;e.payload=function(){return d(h)},e.callback=function(){cg(n,r,s)}}var x=r.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){cg(n,r,s),typeof d!="function"&&(_a===null?_a=new Set([this]):_a.add(this));var _=s.stack;this.componentDidCatch(s.value,{componentStack:_!==null?_:""})})}function qk(e,n,r,s,d){if(r.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=r.alternate,n!==null&&Kr(n,r,d,!0),r=Yt.current,r!==null){switch(r.tag){case 31:case 13:return mn===null?sl():r.alternate===null&&nt===0&&(nt=3),r.flags&=-257,r.flags|=65536,r.lanes=d,s===Li?r.flags|=16384:(n=r.updateQueue,n===null?r.updateQueue=new Set([s]):n.add(s),kd(e,s,d)),!1;case 22:return r.flags|=65536,s===Li?r.flags|=16384:(n=r.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([s])},r.updateQueue=n):(r=n.retryQueue,r===null?n.retryQueue=new Set([s]):r.add(s)),kd(e,s,d)),!1}throw Error(i(435,r.tag))}return kd(e,s,d),sl(),!1}if(Be)return n=Yt.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=d,s!==gu&&(e=Error(i(422),{cause:s}),ts(cn(e,r)))):(s!==gu&&(n=Error(i(423),{cause:s}),ts(cn(n,r))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,s=cn(s,r),d=Zu(e.stateNode,s,d),Nu(e,d),nt!==4&&(nt=2)),!1;var h=Error(i(520),{cause:s});if(h=cn(h,r),ws===null?ws=[h]:ws.push(h),nt!==4&&(nt=2),n===null)return!0;s=cn(s,r),r=n;do{switch(r.tag){case 3:return r.flags|=65536,e=d&-d,r.lanes|=e,e=Zu(r.stateNode,s,e),Nu(r,e),!1;case 1:if(n=r.type,h=r.stateNode,(r.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(_a===null||!_a.has(h))))return r.flags|=65536,d&=-d,r.lanes|=d,d=ug(d),dg(d,e,r,s),Nu(r,d),!1}r=r.return}while(r!==null);return!1}var Qu=Error(i(461)),ct=!1;function vt(e,n,r,s){n.child=e===null?hh(n,null,r,s):mr(n,e.child,r,s)}function fg(e,n,r,s,d){r=r.render;var h=n.ref;if("ref"in s){var x={};for(var _ in s)_!=="ref"&&(x[_]=s[_])}else x=s;return cr(n),s=Du(e,n,r,x,h,d),_=Mu(),e!==null&&!ct?(Lu(e,n,d),Zn(e,n,d)):(Be&&_&&pu(n),n.flags|=1,vt(e,n,s,d),n.child)}function mg(e,n,r,s,d){if(e===null){var h=r.type;return typeof h=="function"&&!du(h)&&h.defaultProps===void 0&&r.compare===null?(n.tag=15,n.type=h,pg(e,n,h,s,d)):(e=_i(r.type,null,s,n,n.mode,d),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!sd(e,d)){var x=h.memoizedProps;if(r=r.compare,r=r!==null?r:Qo,r(x,s)&&e.ref===n.ref)return Zn(e,n,d)}return n.flags|=1,e=Kn(h,s),e.ref=n.ref,e.return=n,n.child=e}function pg(e,n,r,s,d){if(e!==null){var h=e.memoizedProps;if(Qo(h,s)&&e.ref===n.ref)if(ct=!1,n.pendingProps=s=h,sd(e,d))(e.flags&131072)!==0&&(ct=!0);else return n.lanes=e.lanes,Zn(e,n,d)}return Ju(e,n,r,s,d)}function hg(e,n,r,s){var d=s.children,h=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|r:r,e!==null){for(s=n.child=e.child,d=0;s!==null;)d=d|s.lanes|s.childLanes,s=s.sibling;s=d&~h}else s=0,n.child=null;return gg(e,n,h,r,s)}if((r&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Di(n,h!==null?h.cachePool:null),h!==null?yh(n,h):_u(),bh(n);else return s=n.lanes=536870912,gg(e,n,h!==null?h.baseLanes|r:r,r,s)}else h!==null?(Di(n,h.cachePool),yh(n,h),Ca(),n.memoizedState=null):(e!==null&&Di(n,null),_u(),Ca());return vt(e,n,d,r),n.child}function ms(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function gg(e,n,r,s,d){var h=Su();return h=h===null?null:{parent:it._currentValue,pool:h},n.memoizedState={baseLanes:r,cachePool:h},e!==null&&Di(n,null),_u(),bh(n),e!==null&&Kr(e,n,s,!0),n.childLanes=d,null}function Gi(e,n){return n=Zi({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function vg(e,n,r){return mr(n,e.child,null,r),e=Gi(n,n.pendingProps),e.flags|=2,$t(n),n.memoizedState=null,e}function Pk(e,n,r){var s=n.pendingProps,d=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Be){if(s.mode==="hidden")return e=Gi(n,s),n.lanes=536870912,ms(null,e);if(Ru(n),(e=Xe)?(e=_v(e,fn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:va!==null?{id:_n,overflow:An}:null,retryLane:536870912,hydrationErrors:null},r=eh(e),r.return=n,n.child=r,ht=n,Xe=null)):e=null,e===null)throw ba(n);return n.lanes=536870912,null}return Gi(n,s)}var h=e.memoizedState;if(h!==null){var x=h.dehydrated;if(Ru(n),d)if(n.flags&256)n.flags&=-257,n=vg(e,n,r);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(i(558));else if(ct||Kr(e,n,r,!1),d=(r&e.childLanes)!==0,ct||d){if(s=Ve,s!==null&&(x=ip(s,r),x!==0&&x!==h.retryLane))throw h.retryLane=x,or(e,x),zt(s,e,x),Qu;sl(),n=vg(e,n,r)}else e=h.treeContext,Xe=pn(x.nextSibling),ht=n,Be=!0,ya=null,fn=!1,e!==null&&ah(n,e),n=Gi(n,s),n.flags|=4096;return n}return e=Kn(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Xi(e,n){var r=n.ref;if(r===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(i(284));(e===null||e.ref!==r)&&(n.flags|=4194816)}}function Ju(e,n,r,s,d){return cr(n),r=Du(e,n,r,s,void 0,d),s=Mu(),e!==null&&!ct?(Lu(e,n,d),Zn(e,n,d)):(Be&&s&&pu(n),n.flags|=1,vt(e,n,r,d),n.child)}function yg(e,n,r,s,d,h){return cr(n),n.updateQueue=null,r=xh(n,s,r,d),wh(e),s=Mu(),e!==null&&!ct?(Lu(e,n,h),Zn(e,n,h)):(Be&&s&&pu(n),n.flags|=1,vt(e,n,r,h),n.child)}function bg(e,n,r,s,d){if(cr(n),n.stateNode===null){var h=Ir,x=r.contextType;typeof x=="object"&&x!==null&&(h=gt(x)),h=new r(s,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Xu,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=s,h.state=n.memoizedState,h.refs={},Cu(n),x=r.contextType,h.context=typeof x=="object"&&x!==null?gt(x):Ir,h.state=n.memoizedState,x=r.getDerivedStateFromProps,typeof x=="function"&&(Gu(n,r,x,s),h.state=n.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(x=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),x!==h.state&&Xu.enqueueReplaceState(h,h.state,null),ls(n,s,h,d),is(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){h=n.stateNode;var _=n.memoizedProps,z=hr(r,_);h.props=z;var Y=h.context,ne=r.contextType;x=Ir,typeof ne=="object"&&ne!==null&&(x=gt(ne));var oe=r.getDerivedStateFromProps;ne=typeof oe=="function"||typeof h.getSnapshotBeforeUpdate=="function",_=n.pendingProps!==_,ne||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(_||Y!==x)&&og(n,h,s,x),xa=!1;var X=n.memoizedState;h.state=X,ls(n,s,h,d),is(),Y=n.memoizedState,_||X!==Y||xa?(typeof oe=="function"&&(Gu(n,r,oe,s),Y=n.memoizedState),(z=xa||rg(n,r,z,s,X,Y,x))?(ne||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=s,n.memoizedState=Y),h.props=s,h.state=Y,h.context=x,s=z):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{h=n.stateNode,Tu(e,n),x=n.memoizedProps,ne=hr(r,x),h.props=ne,oe=n.pendingProps,X=h.context,Y=r.contextType,z=Ir,typeof Y=="object"&&Y!==null&&(z=gt(Y)),_=r.getDerivedStateFromProps,(Y=typeof _=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(x!==oe||X!==z)&&og(n,h,s,z),xa=!1,X=n.memoizedState,h.state=X,ls(n,s,h,d),is();var J=n.memoizedState;x!==oe||X!==J||xa||e!==null&&e.dependencies!==null&&Ri(e.dependencies)?(typeof _=="function"&&(Gu(n,r,_,s),J=n.memoizedState),(ne=xa||rg(n,r,ne,s,X,J,z)||e!==null&&e.dependencies!==null&&Ri(e.dependencies))?(Y||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(s,J,z),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(s,J,z)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&X===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&X===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=J),h.props=s,h.state=J,h.context=z,s=ne):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&X===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&X===e.memoizedState||(n.flags|=1024),s=!1)}return h=s,Xi(e,n),s=(n.flags&128)!==0,h||s?(h=n.stateNode,r=s&&typeof r.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,e!==null&&s?(n.child=mr(n,e.child,null,d),n.child=mr(n,null,r,d)):vt(e,n,r,d),n.memoizedState=h.state,e=n.child):e=Zn(e,n,d),e}function wg(e,n,r,s){return ir(),n.flags|=256,vt(e,n,r,s),n.child}var ed={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function td(e){return{baseLanes:e,cachePool:ch()}}function nd(e,n,r){return e=e!==null?e.childLanes&~r:0,n&&(e|=Gt),e}function xg(e,n,r){var s=n.pendingProps,d=!1,h=(n.flags&128)!==0,x;if((x=h)||(x=e!==null&&e.memoizedState===null?!1:(rt.current&2)!==0),x&&(d=!0,n.flags&=-129),x=(n.flags&32)!==0,n.flags&=-33,e===null){if(Be){if(d?Ea(n):Ca(),(e=Xe)?(e=_v(e,fn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:va!==null?{id:_n,overflow:An}:null,retryLane:536870912,hydrationErrors:null},r=eh(e),r.return=n,n.child=r,ht=n,Xe=null)):e=null,e===null)throw ba(n);return Bd(e)?n.lanes=32:n.lanes=536870912,null}var _=s.children;return s=s.fallback,d?(Ca(),d=n.mode,_=Zi({mode:"hidden",children:_},d),s=sr(s,d,r,null),_.return=n,s.return=n,_.sibling=s,n.child=_,s=n.child,s.memoizedState=td(r),s.childLanes=nd(e,x,r),n.memoizedState=ed,ms(null,s)):(Ea(n),ad(n,_))}var z=e.memoizedState;if(z!==null&&(_=z.dehydrated,_!==null)){if(h)n.flags&256?(Ea(n),n.flags&=-257,n=rd(e,n,r)):n.memoizedState!==null?(Ca(),n.child=e.child,n.flags|=128,n=null):(Ca(),_=s.fallback,d=n.mode,s=Zi({mode:"visible",children:s.children},d),_=sr(_,d,r,null),_.flags|=2,s.return=n,_.return=n,s.sibling=_,n.child=s,mr(n,e.child,null,r),s=n.child,s.memoizedState=td(r),s.childLanes=nd(e,x,r),n.memoizedState=ed,n=ms(null,s));else if(Ea(n),Bd(_)){if(x=_.nextSibling&&_.nextSibling.dataset,x)var Y=x.dgst;x=Y,s=Error(i(419)),s.stack="",s.digest=x,ts({value:s,source:null,stack:null}),n=rd(e,n,r)}else if(ct||Kr(e,n,r,!1),x=(r&e.childLanes)!==0,ct||x){if(x=Ve,x!==null&&(s=ip(x,r),s!==0&&s!==z.retryLane))throw z.retryLane=s,or(e,s),zt(x,e,s),Qu;Hd(_)||sl(),n=rd(e,n,r)}else Hd(_)?(n.flags|=192,n.child=e.child,n=null):(e=z.treeContext,Xe=pn(_.nextSibling),ht=n,Be=!0,ya=null,fn=!1,e!==null&&ah(n,e),n=ad(n,s.children),n.flags|=4096);return n}return d?(Ca(),_=s.fallback,d=n.mode,z=e.child,Y=z.sibling,s=Kn(z,{mode:"hidden",children:s.children}),s.subtreeFlags=z.subtreeFlags&65011712,Y!==null?_=Kn(Y,_):(_=sr(_,d,r,null),_.flags|=2),_.return=n,s.return=n,s.sibling=_,n.child=s,ms(null,s),s=n.child,_=e.child.memoizedState,_===null?_=td(r):(d=_.cachePool,d!==null?(z=it._currentValue,d=d.parent!==z?{parent:z,pool:z}:d):d=ch(),_={baseLanes:_.baseLanes|r,cachePool:d}),s.memoizedState=_,s.childLanes=nd(e,x,r),n.memoizedState=ed,ms(e.child,s)):(Ea(n),r=e.child,e=r.sibling,r=Kn(r,{mode:"visible",children:s.children}),r.return=n,r.sibling=null,e!==null&&(x=n.deletions,x===null?(n.deletions=[e],n.flags|=16):x.push(e)),n.child=r,n.memoizedState=null,r)}function ad(e,n){return n=Zi({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Zi(e,n){return e=Kt(22,e,null,n),e.lanes=0,e}function rd(e,n,r){return mr(n,e.child,null,r),e=ad(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function kg(e,n,r){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),bu(e.return,n,r)}function od(e,n,r,s,d,h){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:r,tailMode:d,treeForkCount:h}:(x.isBackwards=n,x.rendering=null,x.renderingStartTime=0,x.last=s,x.tail=r,x.tailMode=d,x.treeForkCount=h)}function Sg(e,n,r){var s=n.pendingProps,d=s.revealOrder,h=s.tail;s=s.children;var x=rt.current,_=(x&2)!==0;if(_?(x=x&1|2,n.flags|=128):x&=1,se(rt,x),vt(e,n,s,r),s=Be?es:0,!_&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&kg(e,r,n);else if(e.tag===19)kg(e,r,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(r=n.child,d=null;r!==null;)e=r.alternate,e!==null&&Ui(e)===null&&(d=r),r=r.sibling;r=d,r===null?(d=n.child,n.child=null):(d=r.sibling,r.sibling=null),od(n,!1,d,r,h,s);break;case"backwards":case"unstable_legacy-backwards":for(r=null,d=n.child,n.child=null;d!==null;){if(e=d.alternate,e!==null&&Ui(e)===null){n.child=d;break}e=d.sibling,d.sibling=r,r=d,d=e}od(n,!0,r,null,h,s);break;case"together":od(n,!1,null,null,void 0,s);break;default:n.memoizedState=null}return n.child}function Zn(e,n,r){if(e!==null&&(n.dependencies=e.dependencies),ja|=n.lanes,(r&n.childLanes)===0)if(e!==null){if(Kr(e,n,r,!1),(r&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(i(153));if(n.child!==null){for(e=n.child,r=Kn(e,e.pendingProps),n.child=r,r.return=n;e.sibling!==null;)e=e.sibling,r=r.sibling=Kn(e,e.pendingProps),r.return=n;r.sibling=null}return n.child}function sd(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Ri(e)))}function Fk(e,n,r){switch(n.tag){case 3:ie(n,n.stateNode.containerInfo),wa(n,it,e.memoizedState.cache),ir();break;case 27:case 5:ce(n);break;case 4:ie(n,n.stateNode.containerInfo);break;case 10:wa(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Ru(n),null;break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(Ea(n),n.flags|=128,null):(r&n.child.childLanes)!==0?xg(e,n,r):(Ea(n),e=Zn(e,n,r),e!==null?e.sibling:null);Ea(n);break;case 19:var d=(e.flags&128)!==0;if(s=(r&n.childLanes)!==0,s||(Kr(e,n,r,!1),s=(r&n.childLanes)!==0),d){if(s)return Sg(e,n,r);n.flags|=128}if(d=n.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),se(rt,rt.current),s)break;return null;case 22:return n.lanes=0,hg(e,n,r,n.pendingProps);case 24:wa(n,it,e.memoizedState.cache)}return Zn(e,n,r)}function Eg(e,n,r){if(e!==null)if(e.memoizedProps!==n.pendingProps)ct=!0;else{if(!sd(e,r)&&(n.flags&128)===0)return ct=!1,Fk(e,n,r);ct=(e.flags&131072)!==0}else ct=!1,Be&&(n.flags&1048576)!==0&&nh(n,es,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=dr(n.elementType),n.type=e,typeof e=="function")du(e)?(s=hr(e,s),n.tag=1,n=bg(null,n,e,s,r)):(n.tag=0,n=Ju(null,n,e,s,r));else{if(e!=null){var d=e.$$typeof;if(d===j){n.tag=11,n=fg(null,n,e,s,r);break e}else if(d===L){n.tag=14,n=mg(null,n,e,s,r);break e}}throw n=Q(e)||e,Error(i(306,n,""))}}return n;case 0:return Ju(e,n,n.type,n.pendingProps,r);case 1:return s=n.type,d=hr(s,n.pendingProps),bg(e,n,s,d,r);case 3:e:{if(ie(n,n.stateNode.containerInfo),e===null)throw Error(i(387));s=n.pendingProps;var h=n.memoizedState;d=h.element,Tu(e,n),ls(n,s,null,r);var x=n.memoizedState;if(s=x.cache,wa(n,it,s),s!==h.cache&&wu(n,[it],r,!0),is(),s=x.element,h.isDehydrated)if(h={element:s,isDehydrated:!1,cache:x.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=wg(e,n,s,r);break e}else if(s!==d){d=cn(Error(i(424)),n),ts(d),n=wg(e,n,s,r);break e}else for(e=n.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Xe=pn(e.firstChild),ht=n,Be=!0,ya=null,fn=!0,r=hh(n,null,s,r),n.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ir(),s===d){n=Zn(e,n,r);break e}vt(e,n,s,r)}n=n.child}return n;case 26:return Xi(e,n),e===null?(r=Lv(n.type,null,n.pendingProps,null))?n.memoizedState=r:Be||(r=n.type,e=n.pendingProps,s=ml(me.current).createElement(r),s[pt]=n,s[At]=e,yt(s,r,e),ft(s),n.stateNode=s):n.memoizedState=Lv(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return ce(n),e===null&&Be&&(s=n.stateNode=Ov(n.type,n.pendingProps,me.current),ht=n,fn=!0,d=Xe,Da(n.type)?(Ud=d,Xe=pn(s.firstChild)):Xe=d),vt(e,n,n.pendingProps.children,r),Xi(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Be&&((d=s=Xe)&&(s=w2(s,n.type,n.pendingProps,fn),s!==null?(n.stateNode=s,ht=n,Xe=pn(s.firstChild),fn=!1,d=!0):d=!1),d||ba(n)),ce(n),d=n.type,h=n.pendingProps,x=e!==null?e.memoizedProps:null,s=h.children,Md(d,h)?s=null:x!==null&&Md(d,x)&&(n.flags|=32),n.memoizedState!==null&&(d=Du(e,n,Lk,null,null,r),js._currentValue=d),Xi(e,n),vt(e,n,s,r),n.child;case 6:return e===null&&Be&&((e=r=Xe)&&(r=x2(r,n.pendingProps,fn),r!==null?(n.stateNode=r,ht=n,Xe=null,e=!0):e=!1),e||ba(n)),null;case 13:return xg(e,n,r);case 4:return ie(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=mr(n,null,s,r):vt(e,n,s,r),n.child;case 11:return fg(e,n,n.type,n.pendingProps,r);case 7:return vt(e,n,n.pendingProps,r),n.child;case 8:return vt(e,n,n.pendingProps.children,r),n.child;case 12:return vt(e,n,n.pendingProps.children,r),n.child;case 10:return s=n.pendingProps,wa(n,n.type,s.value),vt(e,n,s.children,r),n.child;case 9:return d=n.type._context,s=n.pendingProps.children,cr(n),d=gt(d),s=s(d),n.flags|=1,vt(e,n,s,r),n.child;case 14:return mg(e,n,n.type,n.pendingProps,r);case 15:return pg(e,n,n.type,n.pendingProps,r);case 19:return Sg(e,n,r);case 31:return Pk(e,n,r);case 22:return hg(e,n,r,n.pendingProps);case 24:return cr(n),s=gt(it),e===null?(d=Su(),d===null&&(d=Ve,h=xu(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=r),d=h),n.memoizedState={parent:s,cache:d},Cu(n),wa(n,it,d)):((e.lanes&r)!==0&&(Tu(e,n),ls(n,null,null,r),is()),d=e.memoizedState,h=n.memoizedState,d.parent!==s?(d={parent:s,cache:s},n.memoizedState=d,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=d),wa(n,it,s)):(s=h.cache,wa(n,it,s),s!==d.cache&&wu(n,[it],r,!0))),vt(e,n,n.pendingProps.children,r),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function Qn(e){e.flags|=4}function id(e,n,r,s,d){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(Zg())e.flags|=8192;else throw fr=Li,Eu}else e.flags&=-16777217}function Cg(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Wv(n))if(Zg())e.flags|=8192;else throw fr=Li,Eu}function Qi(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?rp():536870912,e.lanes|=n,ao|=n)}function ps(e,n){if(!Be)switch(e.tailMode){case"hidden":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Ze(e){var n=e.alternate!==null&&e.alternate.child===e.child,r=0,s=0;if(n)for(var d=e.child;d!==null;)r|=d.lanes|d.childLanes,s|=d.subtreeFlags&65011712,s|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)r|=d.lanes|d.childLanes,s|=d.subtreeFlags,s|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=s,e.childLanes=r,n}function Kk(e,n,r){var s=n.pendingProps;switch(hu(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ze(n),null;case 1:return Ze(n),null;case 3:return r=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Vn(it),le(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Fr(n)?Qn(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,vu())),Ze(n),null;case 26:var d=n.type,h=n.memoizedState;return e===null?(Qn(n),h!==null?(Ze(n),Cg(n,h)):(Ze(n),id(n,d,null,s,r))):h?h!==e.memoizedState?(Qn(n),Ze(n),Cg(n,h)):(Ze(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&Qn(n),Ze(n),id(n,d,e,s,r)),null;case 27:if(de(n),r=me.current,d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Qn(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return Ze(n),null}e=te.current,Fr(n)?rh(n):(e=Ov(d,s,r),n.stateNode=e,Qn(n))}return Ze(n),null;case 5:if(de(n),d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Qn(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return Ze(n),null}if(h=te.current,Fr(n))rh(n);else{var x=ml(me.current);switch(h){case 1:h=x.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:h=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":h=x.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":h=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":h=x.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof s.is=="string"?x.createElement("select",{is:s.is}):x.createElement("select"),s.multiple?h.multiple=!0:s.size&&(h.size=s.size);break;default:h=typeof s.is=="string"?x.createElement(d,{is:s.is}):x.createElement(d)}}h[pt]=n,h[At]=s;e:for(x=n.child;x!==null;){if(x.tag===5||x.tag===6)h.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===n)break e;for(;x.sibling===null;){if(x.return===null||x.return===n)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}n.stateNode=h;e:switch(yt(h,d,s),d){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Qn(n)}}return Ze(n),id(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,r),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&Qn(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(i(166));if(e=me.current,Fr(n)){if(e=n.stateNode,r=n.memoizedProps,s=null,d=ht,d!==null)switch(d.tag){case 27:case 5:s=d.memoizedProps}e[pt]=n,e=!!(e.nodeValue===r||s!==null&&s.suppressHydrationWarning===!0||xv(e.nodeValue,r)),e||ba(n,!0)}else e=ml(e).createTextNode(s),e[pt]=n,n.stateNode=e}return Ze(n),null;case 31:if(r=n.memoizedState,e===null||e.memoizedState!==null){if(s=Fr(n),r!==null){if(e===null){if(!s)throw Error(i(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[pt]=n}else ir(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ze(n),e=!1}else r=vu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return n.flags&256?($t(n),n):($t(n),null);if((n.flags&128)!==0)throw Error(i(558))}return Ze(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=Fr(n),s!==null&&s.dehydrated!==null){if(e===null){if(!d)throw Error(i(318));if(d=n.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(i(317));d[pt]=n}else ir(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ze(n),d=!1}else d=vu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return n.flags&256?($t(n),n):($t(n),null)}return $t(n),(n.flags&128)!==0?(n.lanes=r,n):(r=s!==null,e=e!==null&&e.memoizedState!==null,r&&(s=n.child,d=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(d=s.alternate.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==d&&(s.flags|=2048)),r!==e&&r&&(n.child.flags|=8192),Qi(n,n.updateQueue),Ze(n),null);case 4:return le(),e===null&&_d(n.stateNode.containerInfo),Ze(n),null;case 10:return Vn(n.type),Ze(n),null;case 19:if(B(rt),s=n.memoizedState,s===null)return Ze(n),null;if(d=(n.flags&128)!==0,h=s.rendering,h===null)if(d)ps(s,!1);else{if(nt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=Ui(e),h!==null){for(n.flags|=128,ps(s,!1),e=h.updateQueue,n.updateQueue=e,Qi(n,e),n.subtreeFlags=0,e=r,r=n.child;r!==null;)Jp(r,e),r=r.sibling;return se(rt,rt.current&1|2),Be&&Yn(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&we()>al&&(n.flags|=128,d=!0,ps(s,!1),n.lanes=4194304)}else{if(!d)if(e=Ui(h),e!==null){if(n.flags|=128,d=!0,e=e.updateQueue,n.updateQueue=e,Qi(n,e),ps(s,!0),s.tail===null&&s.tailMode==="hidden"&&!h.alternate&&!Be)return Ze(n),null}else 2*we()-s.renderingStartTime>al&&r!==536870912&&(n.flags|=128,d=!0,ps(s,!1),n.lanes=4194304);s.isBackwards?(h.sibling=n.child,n.child=h):(e=s.last,e!==null?e.sibling=h:n.child=h,s.last=h)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=we(),e.sibling=null,r=rt.current,se(rt,d?r&1|2:r&1),Be&&Yn(n,s.treeForkCount),e):(Ze(n),null);case 22:case 23:return $t(n),Au(),s=n.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(r&536870912)!==0&&(n.flags&128)===0&&(Ze(n),n.subtreeFlags&6&&(n.flags|=8192)):Ze(n),r=n.updateQueue,r!==null&&Qi(n,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==r&&(n.flags|=2048),e!==null&&B(ur),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),Vn(it),Ze(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function Yk(e,n){switch(hu(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Vn(it),le(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return de(n),null;case 31:if(n.memoizedState!==null){if($t(n),n.alternate===null)throw Error(i(340));ir()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if($t(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));ir()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return B(rt),null;case 4:return le(),null;case 10:return Vn(n.type),null;case 22:case 23:return $t(n),Au(),e!==null&&B(ur),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Vn(it),null;case 25:return null;default:return null}}function Tg(e,n){switch(hu(n),n.tag){case 3:Vn(it),le();break;case 26:case 27:case 5:de(n);break;case 4:le();break;case 31:n.memoizedState!==null&&$t(n);break;case 13:$t(n);break;case 19:B(rt);break;case 10:Vn(n.type);break;case 22:case 23:$t(n),Au(),e!==null&&B(ur);break;case 24:Vn(it)}}function hs(e,n){try{var r=n.updateQueue,s=r!==null?r.lastEffect:null;if(s!==null){var d=s.next;r=d;do{if((r.tag&e)===e){s=void 0;var h=r.create,x=r.inst;s=h(),x.destroy=s}r=r.next}while(r!==d)}}catch(_){Fe(n,n.return,_)}}function Ta(e,n,r){try{var s=n.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var h=d.next;s=h;do{if((s.tag&e)===e){var x=s.inst,_=x.destroy;if(_!==void 0){x.destroy=void 0,d=n;var z=r,Y=_;try{Y()}catch(ne){Fe(d,z,ne)}}}s=s.next}while(s!==h)}}catch(ne){Fe(n,n.return,ne)}}function Ng(e){var n=e.updateQueue;if(n!==null){var r=e.stateNode;try{vh(n,r)}catch(s){Fe(e,e.return,s)}}}function jg(e,n,r){r.props=hr(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(s){Fe(e,n,s)}}function gs(e,n){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof r=="function"?e.refCleanup=r(s):r.current=s}}catch(d){Fe(e,n,d)}}function Rn(e,n){var r=e.ref,s=e.refCleanup;if(r!==null)if(typeof s=="function")try{s()}catch(d){Fe(e,n,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(d){Fe(e,n,d)}else r.current=null}function _g(e){var n=e.type,r=e.memoizedProps,s=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&s.focus();break e;case"img":r.src?s.src=r.src:r.srcSet&&(s.srcset=r.srcSet)}}catch(d){Fe(e,e.return,d)}}function ld(e,n,r){try{var s=e.stateNode;p2(s,e.type,r,n),s[At]=n}catch(d){Fe(e,e.return,d)}}function Ag(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Da(e.type)||e.tag===4}function cd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ag(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 ud(e,n,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(e),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=Pn));else if(s!==4&&(s===27&&Da(e.type)&&(r=e.stateNode,n=null),e=e.child,e!==null))for(ud(e,n,r),e=e.sibling;e!==null;)ud(e,n,r),e=e.sibling}function Ji(e,n,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?r.insertBefore(e,n):r.appendChild(e);else if(s!==4&&(s===27&&Da(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(Ji(e,n,r),e=e.sibling;e!==null;)Ji(e,n,r),e=e.sibling}function Rg(e){var n=e.stateNode,r=e.memoizedProps;try{for(var s=e.type,d=n.attributes;d.length;)n.removeAttributeNode(d[0]);yt(n,s,r),n[pt]=e,n[At]=r}catch(h){Fe(e,e.return,h)}}var Jn=!1,ut=!1,dd=!1,Og=typeof WeakSet=="function"?WeakSet:Set,mt=null;function $k(e,n){if(e=e.containerInfo,Od=wl,e=Fp(e),ru(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var s=r.getSelection&&r.getSelection();if(s&&s.rangeCount!==0){r=s.anchorNode;var d=s.anchorOffset,h=s.focusNode;s=s.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var x=0,_=-1,z=-1,Y=0,ne=0,oe=e,X=null;t:for(;;){for(var J;oe!==r||d!==0&&oe.nodeType!==3||(_=x+d),oe!==h||s!==0&&oe.nodeType!==3||(z=x+s),oe.nodeType===3&&(x+=oe.nodeValue.length),(J=oe.firstChild)!==null;)X=oe,oe=J;for(;;){if(oe===e)break t;if(X===r&&++Y===d&&(_=x),X===h&&++ne===s&&(z=x),(J=oe.nextSibling)!==null)break;oe=X,X=oe.parentNode}oe=J}r=_===-1||z===-1?null:{start:_,end:z}}else r=null}r=r||{start:0,end:0}}else r=null;for(Dd={focusedElem:e,selectionRange:r},wl=!1,mt=n;mt!==null;)if(n=mt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,mt=e;else for(;mt!==null;){switch(n=mt,h=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(r=0;r<e.length;r++)d=e[r],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,r=n,d=h.memoizedProps,h=h.memoizedState,s=r.stateNode;try{var he=hr(r.type,d);e=s.getSnapshotBeforeUpdate(he,h),s.__reactInternalSnapshotBeforeUpdate=e}catch(Ce){Fe(r,r.return,Ce)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,r=e.nodeType,r===9)zd(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":zd(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(i(163))}if(e=n.sibling,e!==null){e.return=n.return,mt=e;break}mt=n.return}}function Dg(e,n,r){var s=r.flags;switch(r.tag){case 0:case 11:case 15:ta(e,r),s&4&&hs(5,r);break;case 1:if(ta(e,r),s&4)if(e=r.stateNode,n===null)try{e.componentDidMount()}catch(x){Fe(r,r.return,x)}else{var d=hr(r.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(d,n,e.__reactInternalSnapshotBeforeUpdate)}catch(x){Fe(r,r.return,x)}}s&64&&Ng(r),s&512&&gs(r,r.return);break;case 3:if(ta(e,r),s&64&&(e=r.updateQueue,e!==null)){if(n=null,r.child!==null)switch(r.child.tag){case 27:case 5:n=r.child.stateNode;break;case 1:n=r.child.stateNode}try{vh(e,n)}catch(x){Fe(r,r.return,x)}}break;case 27:n===null&&s&4&&Rg(r);case 26:case 5:ta(e,r),n===null&&s&4&&_g(r),s&512&&gs(r,r.return);break;case 12:ta(e,r);break;case 31:ta(e,r),s&4&&zg(e,r);break;case 13:ta(e,r),s&4&&Hg(e,r),s&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=n2.bind(null,r),k2(e,r))));break;case 22:if(s=r.memoizedState!==null||Jn,!s){n=n!==null&&n.memoizedState!==null||ut,d=Jn;var h=ut;Jn=s,(ut=n)&&!h?na(e,r,(r.subtreeFlags&8772)!==0):ta(e,r),Jn=d,ut=h}break;case 30:break;default:ta(e,r)}}function Mg(e){var n=e.alternate;n!==null&&(e.alternate=null,Mg(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Ic(n)),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 Je=null,Ot=!1;function ea(e,n,r){for(r=r.child;r!==null;)Lg(e,n,r),r=r.sibling}function Lg(e,n,r){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(Wo,r)}catch{}switch(r.tag){case 26:ut||Rn(r,n),ea(e,n,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:ut||Rn(r,n);var s=Je,d=Ot;Da(r.type)&&(Je=r.stateNode,Ot=!1),ea(e,n,r),Cs(r.stateNode),Je=s,Ot=d;break;case 5:ut||Rn(r,n);case 6:if(s=Je,d=Ot,Je=null,ea(e,n,r),Je=s,Ot=d,Je!==null)if(Ot)try{(Je.nodeType===9?Je.body:Je.nodeName==="HTML"?Je.ownerDocument.body:Je).removeChild(r.stateNode)}catch(h){Fe(r,n,h)}else try{Je.removeChild(r.stateNode)}catch(h){Fe(r,n,h)}break;case 18:Je!==null&&(Ot?(e=Je,Nv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),fo(e)):Nv(Je,r.stateNode));break;case 4:s=Je,d=Ot,Je=r.stateNode.containerInfo,Ot=!0,ea(e,n,r),Je=s,Ot=d;break;case 0:case 11:case 14:case 15:Ta(2,r,n),ut||Ta(4,r,n),ea(e,n,r);break;case 1:ut||(Rn(r,n),s=r.stateNode,typeof s.componentWillUnmount=="function"&&jg(r,n,s)),ea(e,n,r);break;case 21:ea(e,n,r);break;case 22:ut=(s=ut)||r.memoizedState!==null,ea(e,n,r),ut=s;break;default:ea(e,n,r)}}function zg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{fo(e)}catch(r){Fe(n,n.return,r)}}}function Hg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{fo(e)}catch(r){Fe(n,n.return,r)}}function Vk(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Og),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Og),n;default:throw Error(i(435,e.tag))}}function el(e,n){var r=Vk(e);n.forEach(function(s){if(!r.has(s)){r.add(s);var d=a2.bind(null,e,s);s.then(d,d)}})}function Dt(e,n){var r=n.deletions;if(r!==null)for(var s=0;s<r.length;s++){var d=r[s],h=e,x=n,_=x;e:for(;_!==null;){switch(_.tag){case 27:if(Da(_.type)){Je=_.stateNode,Ot=!1;break e}break;case 5:Je=_.stateNode,Ot=!1;break e;case 3:case 4:Je=_.stateNode.containerInfo,Ot=!0;break e}_=_.return}if(Je===null)throw Error(i(160));Lg(h,x,d),Je=null,Ot=!1,h=d.alternate,h!==null&&(h.return=null),d.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Bg(n,e),n=n.sibling}var bn=null;function Bg(e,n){var r=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Dt(n,e),Mt(e),s&4&&(Ta(3,e,e.return),hs(3,e),Ta(5,e,e.return));break;case 1:Dt(n,e),Mt(e),s&512&&(ut||r===null||Rn(r,r.return)),s&64&&Jn&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?s:r.concat(s))));break;case 26:var d=bn;if(Dt(n,e),Mt(e),s&512&&(ut||r===null||Rn(r,r.return)),s&4){var h=r!==null?r.memoizedState:null;if(s=e.memoizedState,r===null)if(s===null)if(e.stateNode===null){e:{s=e.type,r=e.memoizedProps,d=d.ownerDocument||d;t:switch(s){case"title":h=d.getElementsByTagName("title")[0],(!h||h[Po]||h[pt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=d.createElement(s),d.head.insertBefore(h,d.querySelector("head > title"))),yt(h,s,r),h[pt]=e,ft(h),s=h;break e;case"link":var x=Bv("link","href",d).get(s+(r.href||""));if(x){for(var _=0;_<x.length;_++)if(h=x[_],h.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&h.getAttribute("rel")===(r.rel==null?null:r.rel)&&h.getAttribute("title")===(r.title==null?null:r.title)&&h.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){x.splice(_,1);break t}}h=d.createElement(s),yt(h,s,r),d.head.appendChild(h);break;case"meta":if(x=Bv("meta","content",d).get(s+(r.content||""))){for(_=0;_<x.length;_++)if(h=x[_],h.getAttribute("content")===(r.content==null?null:""+r.content)&&h.getAttribute("name")===(r.name==null?null:r.name)&&h.getAttribute("property")===(r.property==null?null:r.property)&&h.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&h.getAttribute("charset")===(r.charSet==null?null:r.charSet)){x.splice(_,1);break t}}h=d.createElement(s),yt(h,s,r),d.head.appendChild(h);break;default:throw Error(i(468,s))}h[pt]=e,ft(h),s=h}e.stateNode=s}else Uv(d,e.type,e.stateNode);else e.stateNode=Hv(d,s,e.memoizedProps);else h!==s?(h===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):h.count--,s===null?Uv(d,e.type,e.stateNode):Hv(d,s,e.memoizedProps)):s===null&&e.stateNode!==null&&ld(e,e.memoizedProps,r.memoizedProps)}break;case 27:Dt(n,e),Mt(e),s&512&&(ut||r===null||Rn(r,r.return)),r!==null&&s&4&&ld(e,e.memoizedProps,r.memoizedProps);break;case 5:if(Dt(n,e),Mt(e),s&512&&(ut||r===null||Rn(r,r.return)),e.flags&32){d=e.stateNode;try{Mr(d,"")}catch(he){Fe(e,e.return,he)}}s&4&&e.stateNode!=null&&(d=e.memoizedProps,ld(e,d,r!==null?r.memoizedProps:d)),s&1024&&(dd=!0);break;case 6:if(Dt(n,e),Mt(e),s&4){if(e.stateNode===null)throw Error(i(162));s=e.memoizedProps,r=e.stateNode;try{r.nodeValue=s}catch(he){Fe(e,e.return,he)}}break;case 3:if(gl=null,d=bn,bn=pl(n.containerInfo),Dt(n,e),bn=d,Mt(e),s&4&&r!==null&&r.memoizedState.isDehydrated)try{fo(n.containerInfo)}catch(he){Fe(e,e.return,he)}dd&&(dd=!1,Ug(e));break;case 4:s=bn,bn=pl(e.stateNode.containerInfo),Dt(n,e),Mt(e),bn=s;break;case 12:Dt(n,e),Mt(e);break;case 31:Dt(n,e),Mt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,el(e,s)));break;case 13:Dt(n,e),Mt(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(nl=we()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,el(e,s)));break;case 22:d=e.memoizedState!==null;var z=r!==null&&r.memoizedState!==null,Y=Jn,ne=ut;if(Jn=Y||d,ut=ne||z,Dt(n,e),ut=ne,Jn=Y,Mt(e),s&8192)e:for(n=e.stateNode,n._visibility=d?n._visibility&-2:n._visibility|1,d&&(r===null||z||Jn||ut||gr(e)),r=null,n=e;;){if(n.tag===5||n.tag===26){if(r===null){z=r=n;try{if(h=z.stateNode,d)x=h.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{_=z.stateNode;var oe=z.memoizedProps.style,X=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;_.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(he){Fe(z,z.return,he)}}}else if(n.tag===6){if(r===null){z=n;try{z.stateNode.nodeValue=d?"":z.memoizedProps}catch(he){Fe(z,z.return,he)}}}else if(n.tag===18){if(r===null){z=n;try{var J=z.stateNode;d?jv(J,!0):jv(z.stateNode,!1)}catch(he){Fe(z,z.return,he)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;r===n&&(r=null),n=n.return}r===n&&(r=null),n.sibling.return=n.return,n=n.sibling}s&4&&(s=e.updateQueue,s!==null&&(r=s.retryQueue,r!==null&&(s.retryQueue=null,el(e,r))));break;case 19:Dt(n,e),Mt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,el(e,s)));break;case 30:break;case 21:break;default:Dt(n,e),Mt(e)}}function Mt(e){var n=e.flags;if(n&2){try{for(var r,s=e.return;s!==null;){if(Ag(s)){r=s;break}s=s.return}if(r==null)throw Error(i(160));switch(r.tag){case 27:var d=r.stateNode,h=cd(e);Ji(e,h,d);break;case 5:var x=r.stateNode;r.flags&32&&(Mr(x,""),r.flags&=-33);var _=cd(e);Ji(e,_,x);break;case 3:case 4:var z=r.stateNode.containerInfo,Y=cd(e);ud(e,Y,z);break;default:throw Error(i(161))}}catch(ne){Fe(e,e.return,ne)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Ug(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Ug(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function ta(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Dg(e,n.alternate,n),n=n.sibling}function gr(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Ta(4,n,n.return),gr(n);break;case 1:Rn(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&jg(n,n.return,r),gr(n);break;case 27:Cs(n.stateNode);case 26:case 5:Rn(n,n.return),gr(n);break;case 22:n.memoizedState===null&&gr(n);break;case 30:gr(n);break;default:gr(n)}e=e.sibling}}function na(e,n,r){for(r=r&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var s=n.alternate,d=e,h=n,x=h.flags;switch(h.tag){case 0:case 11:case 15:na(d,h,r),hs(4,h);break;case 1:if(na(d,h,r),s=h,d=s.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(Y){Fe(s,s.return,Y)}if(s=h,d=s.updateQueue,d!==null){var _=s.stateNode;try{var z=d.shared.hiddenCallbacks;if(z!==null)for(d.shared.hiddenCallbacks=null,d=0;d<z.length;d++)gh(z[d],_)}catch(Y){Fe(s,s.return,Y)}}r&&x&64&&Ng(h),gs(h,h.return);break;case 27:Rg(h);case 26:case 5:na(d,h,r),r&&s===null&&x&4&&_g(h),gs(h,h.return);break;case 12:na(d,h,r);break;case 31:na(d,h,r),r&&x&4&&zg(d,h);break;case 13:na(d,h,r),r&&x&4&&Hg(d,h);break;case 22:h.memoizedState===null&&na(d,h,r),gs(h,h.return);break;case 30:break;default:na(d,h,r)}n=n.sibling}}function fd(e,n){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&ns(r))}function md(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ns(e))}function wn(e,n,r,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Wg(e,n,r,s),n=n.sibling}function Wg(e,n,r,s){var d=n.flags;switch(n.tag){case 0:case 11:case 15:wn(e,n,r,s),d&2048&&hs(9,n);break;case 1:wn(e,n,r,s);break;case 3:wn(e,n,r,s),d&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ns(e)));break;case 12:if(d&2048){wn(e,n,r,s),e=n.stateNode;try{var h=n.memoizedProps,x=h.id,_=h.onPostCommit;typeof _=="function"&&_(x,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(z){Fe(n,n.return,z)}}else wn(e,n,r,s);break;case 31:wn(e,n,r,s);break;case 13:wn(e,n,r,s);break;case 23:break;case 22:h=n.stateNode,x=n.alternate,n.memoizedState!==null?h._visibility&2?wn(e,n,r,s):vs(e,n):h._visibility&2?wn(e,n,r,s):(h._visibility|=2,eo(e,n,r,s,(n.subtreeFlags&10256)!==0||!1)),d&2048&&fd(x,n);break;case 24:wn(e,n,r,s),d&2048&&md(n.alternate,n);break;default:wn(e,n,r,s)}}function eo(e,n,r,s,d){for(d=d&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,x=n,_=r,z=s,Y=x.flags;switch(x.tag){case 0:case 11:case 15:eo(h,x,_,z,d),hs(8,x);break;case 23:break;case 22:var ne=x.stateNode;x.memoizedState!==null?ne._visibility&2?eo(h,x,_,z,d):vs(h,x):(ne._visibility|=2,eo(h,x,_,z,d)),d&&Y&2048&&fd(x.alternate,x);break;case 24:eo(h,x,_,z,d),d&&Y&2048&&md(x.alternate,x);break;default:eo(h,x,_,z,d)}n=n.sibling}}function vs(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var r=e,s=n,d=s.flags;switch(s.tag){case 22:vs(r,s),d&2048&&fd(s.alternate,s);break;case 24:vs(r,s),d&2048&&md(s.alternate,s);break;default:vs(r,s)}n=n.sibling}}var ys=8192;function to(e,n,r){if(e.subtreeFlags&ys)for(e=e.child;e!==null;)Ig(e,n,r),e=e.sibling}function Ig(e,n,r){switch(e.tag){case 26:to(e,n,r),e.flags&ys&&e.memoizedState!==null&&M2(r,bn,e.memoizedState,e.memoizedProps);break;case 5:to(e,n,r);break;case 3:case 4:var s=bn;bn=pl(e.stateNode.containerInfo),to(e,n,r),bn=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=ys,ys=16777216,to(e,n,r),ys=s):to(e,n,r));break;default:to(e,n,r)}}function qg(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function bs(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];mt=s,Fg(s,e)}qg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Pg(e),e=e.sibling}function Pg(e){switch(e.tag){case 0:case 11:case 15:bs(e),e.flags&2048&&Ta(9,e,e.return);break;case 3:bs(e);break;case 12:bs(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,tl(e)):bs(e);break;default:bs(e)}}function tl(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];mt=s,Fg(s,e)}qg(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Ta(8,n,n.return),tl(n);break;case 22:r=n.stateNode,r._visibility&2&&(r._visibility&=-3,tl(n));break;default:tl(n)}e=e.sibling}}function Fg(e,n){for(;mt!==null;){var r=mt;switch(r.tag){case 0:case 11:case 15:Ta(8,r,n);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var s=r.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:ns(r.memoizedState.cache)}if(s=r.child,s!==null)s.return=r,mt=s;else e:for(r=e;mt!==null;){s=mt;var d=s.sibling,h=s.return;if(Mg(s),s===r){mt=null;break e}if(d!==null){d.return=h,mt=d;break e}mt=h}}}var Gk={getCacheForType:function(e){var n=gt(it),r=n.data.get(e);return r===void 0&&(r=e(),n.data.set(e,r)),r},cacheSignal:function(){return gt(it).controller.signal}},Xk=typeof WeakMap=="function"?WeakMap:Map,Ie=0,Ve=null,Me=null,ze=0,Pe=0,Vt=null,Na=!1,no=!1,pd=!1,aa=0,nt=0,ja=0,vr=0,hd=0,Gt=0,ao=0,ws=null,Lt=null,gd=!1,nl=0,Kg=0,al=1/0,rl=null,_a=null,dt=0,Aa=null,ro=null,ra=0,vd=0,yd=null,Yg=null,xs=0,bd=null;function Xt(){return(Ie&2)!==0&&ze!==0?ze&-ze:M.T!==null?Cd():lp()}function $g(){if(Gt===0)if((ze&536870912)===0||Be){var e=fi;fi<<=1,(fi&3932160)===0&&(fi=262144),Gt=e}else Gt=536870912;return e=Yt.current,e!==null&&(e.flags|=32),Gt}function zt(e,n,r){(e===Ve&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)&&(oo(e,0),Ra(e,ze,Gt,!1)),qo(e,r),((Ie&2)===0||e!==Ve)&&(e===Ve&&((Ie&2)===0&&(vr|=r),nt===4&&Ra(e,ze,Gt,!1)),On(e))}function Vg(e,n,r){if((Ie&6)!==0)throw Error(i(327));var s=!r&&(n&127)===0&&(n&e.expiredLanes)===0||Io(e,n),d=s?Jk(e,n):xd(e,n,!0),h=s;do{if(d===0){no&&!s&&Ra(e,n,0,!1);break}else{if(r=e.current.alternate,h&&!Zk(r)){d=xd(e,n,!1),h=!1;continue}if(d===2){if(h=n,e.errorRecoveryDisabledLanes&h)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){n=x;e:{var _=e;d=ws;var z=_.current.memoizedState.isDehydrated;if(z&&(oo(_,x).flags|=256),x=xd(_,x,!1),x!==2){if(pd&&!z){_.errorRecoveryDisabledLanes|=h,vr|=h,d=4;break e}h=Lt,Lt=d,h!==null&&(Lt===null?Lt=h:Lt.push.apply(Lt,h))}d=x}if(h=!1,d!==2)continue}}if(d===1){oo(e,0),Ra(e,n,0,!0);break}e:{switch(s=e,h=d,h){case 0:case 1:throw Error(i(345));case 4:if((n&4194048)!==n)break;case 6:Ra(s,n,Gt,!Na);break e;case 2:Lt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((n&62914560)===n&&(d=nl+300-we(),10<d)){if(Ra(s,n,Gt,!Na),pi(s,0,!0)!==0)break e;ra=n,s.timeoutHandle=Cv(Gg.bind(null,s,r,Lt,rl,gd,n,Gt,vr,ao,Na,h,"Throttled",-0,0),d);break e}Gg(s,r,Lt,rl,gd,n,Gt,vr,ao,Na,h,null,-0,0)}}break}while(!0);On(e)}function Gg(e,n,r,s,d,h,x,_,z,Y,ne,oe,X,J){if(e.timeoutHandle=-1,oe=n.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Pn},Ig(n,h,oe);var he=(h&62914560)===h?nl-we():(h&4194048)===h?Kg-we():0;if(he=L2(oe,he),he!==null){ra=h,e.cancelPendingCommit=he(av.bind(null,e,n,h,r,s,d,x,_,z,ne,oe,null,X,J)),Ra(e,h,x,!Y);return}}av(e,n,h,r,s,d,x,_,z)}function Zk(e){for(var n=e;;){var r=n.tag;if((r===0||r===11||r===15)&&n.flags&16384&&(r=n.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var s=0;s<r.length;s++){var d=r[s],h=d.getSnapshot;d=d.value;try{if(!Ft(h(),d))return!1}catch{return!1}}if(r=n.child,n.subtreeFlags&16384&&r!==null)r.return=n,n=r;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Ra(e,n,r,s){n&=~hd,n&=~vr,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var d=n;0<d;){var h=31-Pt(d),x=1<<h;s[h]=-1,d&=~x}r!==0&&op(e,r,n)}function ol(){return(Ie&6)===0?(ks(0),!1):!0}function wd(){if(Me!==null){if(Pe===0)var e=Me.return;else e=Me,$n=lr=null,zu(e),Gr=null,rs=0,e=Me;for(;e!==null;)Tg(e.alternate,e),e=e.return;Me=null}}function oo(e,n){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,v2(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),ra=0,wd(),Ve=e,Me=r=Kn(e.current,null),ze=n,Pe=0,Vt=null,Na=!1,no=Io(e,n),pd=!1,ao=Gt=hd=vr=ja=nt=0,Lt=ws=null,gd=!1,(n&8)!==0&&(n|=n&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=n;0<s;){var d=31-Pt(s),h=1<<d;n|=e[d],s&=~h}return aa=n,Ti(),r}function Xg(e,n){_e=null,M.H=fs,n===Vr||n===Mi?(n=fh(),Pe=3):n===Eu?(n=fh(),Pe=4):Pe=n===Qu?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Vt=n,Me===null&&(nt=1,Vi(e,cn(n,e.current)))}function Zg(){var e=Yt.current;return e===null?!0:(ze&4194048)===ze?mn===null:(ze&62914560)===ze||(ze&536870912)!==0?e===mn:!1}function Qg(){var e=M.H;return M.H=fs,e===null?fs:e}function Jg(){var e=M.A;return M.A=Gk,e}function sl(){nt=4,Na||(ze&4194048)!==ze&&Yt.current!==null||(no=!0),(ja&134217727)===0&&(vr&134217727)===0||Ve===null||Ra(Ve,ze,Gt,!1)}function xd(e,n,r){var s=Ie;Ie|=2;var d=Qg(),h=Jg();(Ve!==e||ze!==n)&&(rl=null,oo(e,n)),n=!1;var x=nt;e:do try{if(Pe!==0&&Me!==null){var _=Me,z=Vt;switch(Pe){case 8:wd(),x=6;break e;case 3:case 2:case 9:case 6:Yt.current===null&&(n=!0);var Y=Pe;if(Pe=0,Vt=null,so(e,_,z,Y),r&&no){x=0;break e}break;default:Y=Pe,Pe=0,Vt=null,so(e,_,z,Y)}}Qk(),x=nt;break}catch(ne){Xg(e,ne)}while(!0);return n&&e.shellSuspendCounter++,$n=lr=null,Ie=s,M.H=d,M.A=h,Me===null&&(Ve=null,ze=0,Ti()),x}function Qk(){for(;Me!==null;)ev(Me)}function Jk(e,n){var r=Ie;Ie|=2;var s=Qg(),d=Jg();Ve!==e||ze!==n?(rl=null,al=we()+500,oo(e,n)):no=Io(e,n);e:do try{if(Pe!==0&&Me!==null){n=Me;var h=Vt;t:switch(Pe){case 1:Pe=0,Vt=null,so(e,n,h,1);break;case 2:case 9:if(uh(h)){Pe=0,Vt=null,tv(n);break}n=function(){Pe!==2&&Pe!==9||Ve!==e||(Pe=7),On(e)},h.then(n,n);break e;case 3:Pe=7;break e;case 4:Pe=5;break e;case 7:uh(h)?(Pe=0,Vt=null,tv(n)):(Pe=0,Vt=null,so(e,n,h,7));break;case 5:var x=null;switch(Me.tag){case 26:x=Me.memoizedState;case 5:case 27:var _=Me;if(x?Wv(x):_.stateNode.complete){Pe=0,Vt=null;var z=_.sibling;if(z!==null)Me=z;else{var Y=_.return;Y!==null?(Me=Y,il(Y)):Me=null}break t}}Pe=0,Vt=null,so(e,n,h,5);break;case 6:Pe=0,Vt=null,so(e,n,h,6);break;case 8:wd(),nt=6;break e;default:throw Error(i(462))}}e2();break}catch(ne){Xg(e,ne)}while(!0);return $n=lr=null,M.H=s,M.A=d,Ie=r,Me!==null?0:(Ve=null,ze=0,Ti(),nt)}function e2(){for(;Me!==null&&!fa();)ev(Me)}function ev(e){var n=Eg(e.alternate,e,aa);e.memoizedProps=e.pendingProps,n===null?il(e):Me=n}function tv(e){var n=e,r=n.alternate;switch(n.tag){case 15:case 0:n=yg(r,n,n.pendingProps,n.type,void 0,ze);break;case 11:n=yg(r,n,n.pendingProps,n.type.render,n.ref,ze);break;case 5:zu(n);default:Tg(r,n),n=Me=Jp(n,aa),n=Eg(r,n,aa)}e.memoizedProps=e.pendingProps,n===null?il(e):Me=n}function so(e,n,r,s){$n=lr=null,zu(n),Gr=null,rs=0;var d=n.return;try{if(qk(e,d,n,r,ze)){nt=1,Vi(e,cn(r,e.current)),Me=null;return}}catch(h){if(d!==null)throw Me=d,h;nt=1,Vi(e,cn(r,e.current)),Me=null;return}n.flags&32768?(Be||s===1?e=!0:no||(ze&536870912)!==0?e=!1:(Na=e=!0,(s===2||s===9||s===3||s===6)&&(s=Yt.current,s!==null&&s.tag===13&&(s.flags|=16384))),nv(n,e)):il(n)}function il(e){var n=e;do{if((n.flags&32768)!==0){nv(n,Na);return}e=n.return;var r=Kk(n.alternate,n,aa);if(r!==null){Me=r;return}if(n=n.sibling,n!==null){Me=n;return}Me=n=e}while(n!==null);nt===0&&(nt=5)}function nv(e,n){do{var r=Yk(e.alternate,e);if(r!==null){r.flags&=32767,Me=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!n&&(e=e.sibling,e!==null)){Me=e;return}Me=e=r}while(e!==null);nt=6,Me=null}function av(e,n,r,s,d,h,x,_,z){e.cancelPendingCommit=null;do ll();while(dt!==0);if((Ie&6)!==0)throw Error(i(327));if(n!==null){if(n===e.current)throw Error(i(177));if(h=n.lanes|n.childLanes,h|=cu,D1(e,r,h,x,_,z),e===Ve&&(Me=Ve=null,ze=0),ro=n,Aa=e,ra=r,vd=h,yd=d,Yg=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,r2(Re,function(){return lv(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=M.T,M.T=null,d=P.p,P.p=2,x=Ie,Ie|=4;try{$k(e,n,r)}finally{Ie=x,P.p=d,M.T=s}}dt=1,rv(),ov(),sv()}}function rv(){if(dt===1){dt=0;var e=Aa,n=ro,r=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||r){r=M.T,M.T=null;var s=P.p;P.p=2;var d=Ie;Ie|=4;try{Bg(n,e);var h=Dd,x=Fp(e.containerInfo),_=h.focusedElem,z=h.selectionRange;if(x!==_&&_&&_.ownerDocument&&Pp(_.ownerDocument.documentElement,_)){if(z!==null&&ru(_)){var Y=z.start,ne=z.end;if(ne===void 0&&(ne=Y),"selectionStart"in _)_.selectionStart=Y,_.selectionEnd=Math.min(ne,_.value.length);else{var oe=_.ownerDocument||document,X=oe&&oe.defaultView||window;if(X.getSelection){var J=X.getSelection(),he=_.textContent.length,Ce=Math.min(z.start,he),$e=z.end===void 0?Ce:Math.min(z.end,he);!J.extend&&Ce>$e&&(x=$e,$e=Ce,Ce=x);var U=qp(_,Ce),H=qp(_,$e);if(U&&H&&(J.rangeCount!==1||J.anchorNode!==U.node||J.anchorOffset!==U.offset||J.focusNode!==H.node||J.focusOffset!==H.offset)){var K=oe.createRange();K.setStart(U.node,U.offset),J.removeAllRanges(),Ce>$e?(J.addRange(K),J.extend(H.node,H.offset)):(K.setEnd(H.node,H.offset),J.addRange(K))}}}}for(oe=[],J=_;J=J.parentNode;)J.nodeType===1&&oe.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<oe.length;_++){var re=oe[_];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}wl=!!Od,Dd=Od=null}finally{Ie=d,P.p=s,M.T=r}}e.current=n,dt=2}}function ov(){if(dt===2){dt=0;var e=Aa,n=ro,r=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||r){r=M.T,M.T=null;var s=P.p;P.p=2;var d=Ie;Ie|=4;try{Dg(e,n.alternate,n)}finally{Ie=d,P.p=s,M.T=r}}dt=3}}function sv(){if(dt===4||dt===3){dt=0,ma();var e=Aa,n=ro,r=ra,s=Yg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?dt=5:(dt=0,ro=Aa=null,iv(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(_a=null),Uc(r),n=n.stateNode,qt&&typeof qt.onCommitFiberRoot=="function")try{qt.onCommitFiberRoot(Wo,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=M.T,d=P.p,P.p=2,M.T=null;try{for(var h=e.onRecoverableError,x=0;x<s.length;x++){var _=s[x];h(_.value,{componentStack:_.stack})}}finally{M.T=n,P.p=d}}(ra&3)!==0&&ll(),On(e),d=e.pendingLanes,(r&261930)!==0&&(d&42)!==0?e===bd?xs++:(xs=0,bd=e):xs=0,ks(0)}}function iv(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,ns(n)))}function ll(){return rv(),ov(),sv(),lv()}function lv(){if(dt!==5)return!1;var e=Aa,n=vd;vd=0;var r=Uc(ra),s=M.T,d=P.p;try{P.p=32>r?32:r,M.T=null,r=yd,yd=null;var h=Aa,x=ra;if(dt=0,ro=Aa=null,ra=0,(Ie&6)!==0)throw Error(i(331));var _=Ie;if(Ie|=4,Pg(h.current),Wg(h,h.current,x,r),Ie=_,ks(0,!1),qt&&typeof qt.onPostCommitFiberRoot=="function")try{qt.onPostCommitFiberRoot(Wo,h)}catch{}return!0}finally{P.p=d,M.T=s,iv(e,n)}}function cv(e,n,r){n=cn(r,n),n=Zu(e.stateNode,n,2),e=Sa(e,n,2),e!==null&&(qo(e,2),On(e))}function Fe(e,n,r){if(e.tag===3)cv(e,e,r);else for(;n!==null;){if(n.tag===3){cv(n,e,r);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(_a===null||!_a.has(s))){e=cn(r,e),r=ug(2),s=Sa(n,r,2),s!==null&&(dg(r,s,n,e),qo(s,2),On(s));break}}n=n.return}}function kd(e,n,r){var s=e.pingCache;if(s===null){s=e.pingCache=new Xk;var d=new Set;s.set(n,d)}else d=s.get(n),d===void 0&&(d=new Set,s.set(n,d));d.has(r)||(pd=!0,d.add(r),e=t2.bind(null,e,n,r),n.then(e,e))}function t2(e,n,r){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,Ve===e&&(ze&r)===r&&(nt===4||nt===3&&(ze&62914560)===ze&&300>we()-nl?(Ie&2)===0&&oo(e,0):hd|=r,ao===ze&&(ao=0)),On(e)}function uv(e,n){n===0&&(n=rp()),e=or(e,n),e!==null&&(qo(e,n),On(e))}function n2(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),uv(e,r)}function a2(e,n){var r=0;switch(e.tag){case 31:case 13:var s=e.stateNode,d=e.memoizedState;d!==null&&(r=d.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(i(314))}s!==null&&s.delete(n),uv(e,r)}function r2(e,n){return De(e,n)}var cl=null,io=null,Sd=!1,ul=!1,Ed=!1,Oa=0;function On(e){e!==io&&e.next===null&&(io===null?cl=io=e:io=io.next=e),ul=!0,Sd||(Sd=!0,s2())}function ks(e,n){if(!Ed&&ul){Ed=!0;do for(var r=!1,s=cl;s!==null;){if(e!==0){var d=s.pendingLanes;if(d===0)var h=0;else{var x=s.suspendedLanes,_=s.pingedLanes;h=(1<<31-Pt(42|e)+1)-1,h&=d&~(x&~_),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,pv(s,h))}else h=ze,h=pi(s,s===Ve?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(h&3)===0||Io(s,h)||(r=!0,pv(s,h));s=s.next}while(r);Ed=!1}}function o2(){dv()}function dv(){ul=Sd=!1;var e=0;Oa!==0&&g2()&&(e=Oa);for(var n=we(),r=null,s=cl;s!==null;){var d=s.next,h=fv(s,n);h===0?(s.next=null,r===null?cl=d:r.next=d,d===null&&(io=r)):(r=s,(e!==0||(h&3)!==0)&&(ul=!0)),s=d}dt!==0&&dt!==5||ks(e),Oa!==0&&(Oa=0)}function fv(e,n){for(var r=e.suspendedLanes,s=e.pingedLanes,d=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var x=31-Pt(h),_=1<<x,z=d[x];z===-1?((_&r)===0||(_&s)!==0)&&(d[x]=O1(_,n)):z<=n&&(e.expiredLanes|=_),h&=~_}if(n=Ve,r=ze,r=pi(e,e===n?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,r===0||e===n&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&vn(s),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||Io(e,r)){if(n=r&-r,n===e.callbackPriority)return n;switch(s!==null&&vn(s),Uc(r)){case 2:case 8:r=ke;break;case 32:r=Re;break;case 268435456:r=Oe;break;default:r=Re}return s=mv.bind(null,e),r=De(r,s),e.callbackPriority=n,e.callbackNode=r,n}return s!==null&&s!==null&&vn(s),e.callbackPriority=2,e.callbackNode=null,2}function mv(e,n){if(dt!==0&&dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(ll()&&e.callbackNode!==r)return null;var s=ze;return s=pi(e,e===Ve?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Vg(e,s,n),fv(e,we()),e.callbackNode!=null&&e.callbackNode===r?mv.bind(null,e):null)}function pv(e,n){if(ll())return null;Vg(e,n,!0)}function s2(){y2(function(){(Ie&6)!==0?De(In,o2):dv()})}function Cd(){if(Oa===0){var e=Yr;e===0&&(e=di,di<<=1,(di&261888)===0&&(di=256)),Oa=e}return Oa}function hv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:yi(""+e)}function gv(e,n){var r=n.ownerDocument.createElement("input");return r.name=n.name,r.value=n.value,e.id&&r.setAttribute("form",e.id),n.parentNode.insertBefore(r,n),e=new FormData(e),r.parentNode.removeChild(r),e}function i2(e,n,r,s,d){if(n==="submit"&&r&&r.stateNode===d){var h=hv((d[At]||null).action),x=s.submitter;x&&(n=(n=x[At]||null)?hv(n.formAction):x.getAttribute("formAction"),n!==null&&(h=n,x=null));var _=new ki("action","action",null,s,d);e.push({event:_,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Oa!==0){var z=x?gv(d,x):new FormData(d);Ku(r,{pending:!0,data:z,method:d.method,action:h},null,z)}}else typeof h=="function"&&(_.preventDefault(),z=x?gv(d,x):new FormData(d),Ku(r,{pending:!0,data:z,method:d.method,action:h},h,z))},currentTarget:d}]})}}for(var Td=0;Td<lu.length;Td++){var Nd=lu[Td],l2=Nd.toLowerCase(),c2=Nd[0].toUpperCase()+Nd.slice(1);yn(l2,"on"+c2)}yn($p,"onAnimationEnd"),yn(Vp,"onAnimationIteration"),yn(Gp,"onAnimationStart"),yn("dblclick","onDoubleClick"),yn("focusin","onFocus"),yn("focusout","onBlur"),yn(Ck,"onTransitionRun"),yn(Tk,"onTransitionStart"),yn(Nk,"onTransitionCancel"),yn(Xp,"onTransitionEnd"),Or("onMouseEnter",["mouseout","mouseover"]),Or("onMouseLeave",["mouseout","mouseover"]),Or("onPointerEnter",["pointerout","pointerover"]),Or("onPointerLeave",["pointerout","pointerover"]),tr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),tr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),tr("onBeforeInput",["compositionend","keypress","textInput","paste"]),tr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),tr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),tr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ss="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(" "),u2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ss));function vv(e,n){n=(n&4)!==0;for(var r=0;r<e.length;r++){var s=e[r],d=s.event;s=s.listeners;e:{var h=void 0;if(n)for(var x=s.length-1;0<=x;x--){var _=s[x],z=_.instance,Y=_.currentTarget;if(_=_.listener,z!==h&&d.isPropagationStopped())break e;h=_,d.currentTarget=Y;try{h(d)}catch(ne){Ci(ne)}d.currentTarget=null,h=z}else for(x=0;x<s.length;x++){if(_=s[x],z=_.instance,Y=_.currentTarget,_=_.listener,z!==h&&d.isPropagationStopped())break e;h=_,d.currentTarget=Y;try{h(d)}catch(ne){Ci(ne)}d.currentTarget=null,h=z}}}}function Le(e,n){var r=n[Wc];r===void 0&&(r=n[Wc]=new Set);var s=e+"__bubble";r.has(s)||(yv(n,e,2,!1),r.add(s))}function jd(e,n,r){var s=0;n&&(s|=4),yv(r,e,s,n)}var dl="_reactListening"+Math.random().toString(36).slice(2);function _d(e){if(!e[dl]){e[dl]=!0,dp.forEach(function(r){r!=="selectionchange"&&(u2.has(r)||jd(r,!1,e),jd(r,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[dl]||(n[dl]=!0,jd("selectionchange",!1,n))}}function yv(e,n,r,s){switch($v(n)){case 2:var d=B2;break;case 8:d=U2;break;default:d=Fd}r=d.bind(null,n,r,e),d=void 0,!Gc||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(d=!0),s?d!==void 0?e.addEventListener(n,r,{capture:!0,passive:d}):e.addEventListener(n,r,!0):d!==void 0?e.addEventListener(n,r,{passive:d}):e.addEventListener(n,r,!1)}function Ad(e,n,r,s,d){var h=s;if((n&1)===0&&(n&2)===0&&s!==null)e:for(;;){if(s===null)return;var x=s.tag;if(x===3||x===4){var _=s.stateNode.containerInfo;if(_===d)break;if(x===4)for(x=s.return;x!==null;){var z=x.tag;if((z===3||z===4)&&x.stateNode.containerInfo===d)return;x=x.return}for(;_!==null;){if(x=_r(_),x===null)return;if(z=x.tag,z===5||z===6||z===26||z===27){s=h=x;continue e}_=_.parentNode}}s=s.return}Sp(function(){var Y=h,ne=$c(r),oe=[];e:{var X=Zp.get(e);if(X!==void 0){var J=ki,he=e;switch(e){case"keypress":if(wi(r)===0)break e;case"keydown":case"keyup":J=ak;break;case"focusin":he="focus",J=Jc;break;case"focusout":he="blur",J=Jc;break;case"beforeblur":case"afterblur":J=Jc;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":J=Tp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=K1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=sk;break;case $p:case Vp:case Gp:J=V1;break;case Xp:J=lk;break;case"scroll":case"scrollend":J=P1;break;case"wheel":J=uk;break;case"copy":case"cut":case"paste":J=X1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=jp;break;case"toggle":case"beforetoggle":J=fk}var Ce=(n&4)!==0,$e=!Ce&&(e==="scroll"||e==="scrollend"),U=Ce?X!==null?X+"Capture":null:X;Ce=[];for(var H=Y,K;H!==null;){var re=H;if(K=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||K===null||U===null||(re=Ko(H,U),re!=null&&Ce.push(Es(H,re,K))),$e)break;H=H.return}0<Ce.length&&(X=new J(X,he,null,r,ne),oe.push({event:X,listeners:Ce}))}}if((n&7)===0){e:{if(X=e==="mouseover"||e==="pointerover",J=e==="mouseout"||e==="pointerout",X&&r!==Yc&&(he=r.relatedTarget||r.fromElement)&&(_r(he)||he[jr]))break e;if((J||X)&&(X=ne.window===ne?ne:(X=ne.ownerDocument)?X.defaultView||X.parentWindow:window,J?(he=r.relatedTarget||r.toElement,J=Y,he=he?_r(he):null,he!==null&&($e=u(he),Ce=he.tag,he!==$e||Ce!==5&&Ce!==27&&Ce!==6)&&(he=null)):(J=null,he=Y),J!==he)){if(Ce=Tp,re="onMouseLeave",U="onMouseEnter",H="mouse",(e==="pointerout"||e==="pointerover")&&(Ce=jp,re="onPointerLeave",U="onPointerEnter",H="pointer"),$e=J==null?X:Fo(J),K=he==null?X:Fo(he),X=new Ce(re,H+"leave",J,r,ne),X.target=$e,X.relatedTarget=K,re=null,_r(ne)===Y&&(Ce=new Ce(U,H+"enter",he,r,ne),Ce.target=K,Ce.relatedTarget=$e,re=Ce),$e=re,J&&he)t:{for(Ce=d2,U=J,H=he,K=0,re=U;re;re=Ce(re))K++;re=0;for(var Ee=H;Ee;Ee=Ce(Ee))re++;for(;0<K-re;)U=Ce(U),K--;for(;0<re-K;)H=Ce(H),re--;for(;K--;){if(U===H||H!==null&&U===H.alternate){Ce=U;break t}U=Ce(U),H=Ce(H)}Ce=null}else Ce=null;J!==null&&bv(oe,X,J,Ce,!1),he!==null&&$e!==null&&bv(oe,$e,he,Ce,!0)}}e:{if(X=Y?Fo(Y):window,J=X.nodeName&&X.nodeName.toLowerCase(),J==="select"||J==="input"&&X.type==="file")var Ue=zp;else if(Mp(X))if(Hp)Ue=kk;else{Ue=wk;var be=bk}else J=X.nodeName,!J||J.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?Y&&Kc(Y.elementType)&&(Ue=zp):Ue=xk;if(Ue&&(Ue=Ue(e,Y))){Lp(oe,Ue,r,ne);break e}be&&be(e,X,Y),e==="focusout"&&Y&&X.type==="number"&&Y.memoizedProps.value!=null&&Fc(X,"number",X.value)}switch(be=Y?Fo(Y):window,e){case"focusin":(Mp(be)||be.contentEditable==="true")&&(Br=be,ou=Y,Jo=null);break;case"focusout":Jo=ou=Br=null;break;case"mousedown":su=!0;break;case"contextmenu":case"mouseup":case"dragend":su=!1,Kp(oe,r,ne);break;case"selectionchange":if(Ek)break;case"keydown":case"keyup":Kp(oe,r,ne)}var Ae;if(tu)e:{switch(e){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else Hr?Op(e,r)&&(He="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(He="onCompositionStart");He&&(_p&&r.locale!=="ko"&&(Hr||He!=="onCompositionStart"?He==="onCompositionEnd"&&Hr&&(Ae=Ep()):(ga=ne,Xc="value"in ga?ga.value:ga.textContent,Hr=!0)),be=fl(Y,He),0<be.length&&(He=new Np(He,e,null,r,ne),oe.push({event:He,listeners:be}),Ae?He.data=Ae:(Ae=Dp(r),Ae!==null&&(He.data=Ae)))),(Ae=pk?hk(e,r):gk(e,r))&&(He=fl(Y,"onBeforeInput"),0<He.length&&(be=new Np("onBeforeInput","beforeinput",null,r,ne),oe.push({event:be,listeners:He}),be.data=Ae)),i2(oe,e,Y,r,ne)}vv(oe,n)})}function Es(e,n,r){return{instance:e,listener:n,currentTarget:r}}function fl(e,n){for(var r=n+"Capture",s=[];e!==null;){var d=e,h=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||h===null||(d=Ko(e,r),d!=null&&s.unshift(Es(e,d,h)),d=Ko(e,n),d!=null&&s.push(Es(e,d,h))),e.tag===3)return s;e=e.return}return[]}function d2(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function bv(e,n,r,s,d){for(var h=n._reactName,x=[];r!==null&&r!==s;){var _=r,z=_.alternate,Y=_.stateNode;if(_=_.tag,z!==null&&z===s)break;_!==5&&_!==26&&_!==27||Y===null||(z=Y,d?(Y=Ko(r,h),Y!=null&&x.unshift(Es(r,Y,z))):d||(Y=Ko(r,h),Y!=null&&x.push(Es(r,Y,z)))),r=r.return}x.length!==0&&e.push({event:n,listeners:x})}var f2=/\r\n?/g,m2=/\u0000|\uFFFD/g;function wv(e){return(typeof e=="string"?e:""+e).replace(f2,`
|
|
10
|
-
`).replace(m2,"")}function xv(e,n){return n=wv(n),wv(e)===n}function Ye(e,n,r,s,d,h){switch(r){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||Mr(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&Mr(e,""+s);break;case"className":gi(e,"class",s);break;case"tabIndex":gi(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":gi(e,r,s);break;case"style":xp(e,s,h);break;case"data":if(n!=="object"){gi(e,"data",s);break}case"src":case"href":if(s===""&&(n!=="a"||r!=="href")){e.removeAttribute(r);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(r);break}s=yi(""+s),e.setAttribute(r,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(r,"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 h=="function"&&(r==="formAction"?(n!=="input"&&Ye(e,n,"name",d.name,d,null),Ye(e,n,"formEncType",d.formEncType,d,null),Ye(e,n,"formMethod",d.formMethod,d,null),Ye(e,n,"formTarget",d.formTarget,d,null)):(Ye(e,n,"encType",d.encType,d,null),Ye(e,n,"method",d.method,d,null),Ye(e,n,"target",d.target,d,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(r);break}s=yi(""+s),e.setAttribute(r,s);break;case"onClick":s!=null&&(e.onclick=Pn);break;case"onScroll":s!=null&&Le("scroll",e);break;case"onScrollEnd":s!=null&&Le("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(r=s.__html,r!=null){if(d.children!=null)throw Error(i(60));e.innerHTML=r}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}r=yi(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(r,""+s):e.removeAttribute(r);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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":s===!0?e.setAttribute(r,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(r,s):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(r,s):e.removeAttribute(r);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(r):e.setAttribute(r,s);break;case"popover":Le("beforetoggle",e),Le("toggle",e),hi(e,"popover",s);break;case"xlinkActuate":qn(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":qn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":qn(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":qn(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":qn(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":qn(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":qn(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":qn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":qn(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":hi(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=I1.get(r)||r,hi(e,r,s))}}function Rd(e,n,r,s,d,h){switch(r){case"style":xp(e,s,h);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(r=s.__html,r!=null){if(d.children!=null)throw Error(i(60));e.innerHTML=r}}break;case"children":typeof s=="string"?Mr(e,s):(typeof s=="number"||typeof s=="bigint")&&Mr(e,""+s);break;case"onScroll":s!=null&&Le("scroll",e);break;case"onScrollEnd":s!=null&&Le("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Pn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!fp.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(d=r.endsWith("Capture"),n=r.slice(2,d?r.length-7:void 0),h=e[At]||null,h=h!=null?h[r]:null,typeof h=="function"&&e.removeEventListener(n,h,d),typeof s=="function")){typeof h!="function"&&h!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(n,s,d);break e}r in e?e[r]=s:s===!0?e.setAttribute(r,""):hi(e,r,s)}}}function yt(e,n,r){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",e),Le("load",e);var s=!1,d=!1,h;for(h in r)if(r.hasOwnProperty(h)){var x=r[h];if(x!=null)switch(h){case"src":s=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Ye(e,n,h,x,r,null)}}d&&Ye(e,n,"srcSet",r.srcSet,r,null),s&&Ye(e,n,"src",r.src,r,null);return;case"input":Le("invalid",e);var _=h=x=d=null,z=null,Y=null;for(s in r)if(r.hasOwnProperty(s)){var ne=r[s];if(ne!=null)switch(s){case"name":d=ne;break;case"type":x=ne;break;case"checked":z=ne;break;case"defaultChecked":Y=ne;break;case"value":h=ne;break;case"defaultValue":_=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(i(137,n));break;default:Ye(e,n,s,ne,r,null)}}vp(e,h,_,z,Y,x,d,!1);return;case"select":Le("invalid",e),s=x=h=null;for(d in r)if(r.hasOwnProperty(d)&&(_=r[d],_!=null))switch(d){case"value":h=_;break;case"defaultValue":x=_;break;case"multiple":s=_;default:Ye(e,n,d,_,r,null)}n=h,r=x,e.multiple=!!s,n!=null?Dr(e,!!s,n,!1):r!=null&&Dr(e,!!s,r,!0);return;case"textarea":Le("invalid",e),h=d=s=null;for(x in r)if(r.hasOwnProperty(x)&&(_=r[x],_!=null))switch(x){case"value":s=_;break;case"defaultValue":d=_;break;case"children":h=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(i(91));break;default:Ye(e,n,x,_,r,null)}bp(e,s,d,h);return;case"option":for(z in r)r.hasOwnProperty(z)&&(s=r[z],s!=null)&&(z==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":Ye(e,n,z,s,r,null));return;case"dialog":Le("beforetoggle",e),Le("toggle",e),Le("cancel",e),Le("close",e);break;case"iframe":case"object":Le("load",e);break;case"video":case"audio":for(s=0;s<Ss.length;s++)Le(Ss[s],e);break;case"image":Le("error",e),Le("load",e);break;case"details":Le("toggle",e);break;case"embed":case"source":case"link":Le("error",e),Le("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(Y in r)if(r.hasOwnProperty(Y)&&(s=r[Y],s!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Ye(e,n,Y,s,r,null)}return;default:if(Kc(n)){for(ne in r)r.hasOwnProperty(ne)&&(s=r[ne],s!==void 0&&Rd(e,n,ne,s,r,void 0));return}}for(_ in r)r.hasOwnProperty(_)&&(s=r[_],s!=null&&Ye(e,n,_,s,r,null))}function p2(e,n,r,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,h=null,x=null,_=null,z=null,Y=null,ne=null;for(J in r){var oe=r[J];if(r.hasOwnProperty(J)&&oe!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":z=oe;default:s.hasOwnProperty(J)||Ye(e,n,J,null,s,oe)}}for(var X in s){var J=s[X];if(oe=r[X],s.hasOwnProperty(X)&&(J!=null||oe!=null))switch(X){case"type":h=J;break;case"name":d=J;break;case"checked":Y=J;break;case"defaultChecked":ne=J;break;case"value":x=J;break;case"defaultValue":_=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(i(137,n));break;default:J!==oe&&Ye(e,n,X,J,s,oe)}}Pc(e,x,_,z,Y,ne,h,d);return;case"select":J=x=_=X=null;for(h in r)if(z=r[h],r.hasOwnProperty(h)&&z!=null)switch(h){case"value":break;case"multiple":J=z;default:s.hasOwnProperty(h)||Ye(e,n,h,null,s,z)}for(d in s)if(h=s[d],z=r[d],s.hasOwnProperty(d)&&(h!=null||z!=null))switch(d){case"value":X=h;break;case"defaultValue":_=h;break;case"multiple":x=h;default:h!==z&&Ye(e,n,d,h,s,z)}n=_,r=x,s=J,X!=null?Dr(e,!!r,X,!1):!!s!=!!r&&(n!=null?Dr(e,!!r,n,!0):Dr(e,!!r,r?[]:"",!1));return;case"textarea":J=X=null;for(_ in r)if(d=r[_],r.hasOwnProperty(_)&&d!=null&&!s.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:Ye(e,n,_,null,s,d)}for(x in s)if(d=s[x],h=r[x],s.hasOwnProperty(x)&&(d!=null||h!=null))switch(x){case"value":X=d;break;case"defaultValue":J=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(i(91));break;default:d!==h&&Ye(e,n,x,d,s,h)}yp(e,X,J);return;case"option":for(var he in r)X=r[he],r.hasOwnProperty(he)&&X!=null&&!s.hasOwnProperty(he)&&(he==="selected"?e.selected=!1:Ye(e,n,he,null,s,X));for(z in s)X=s[z],J=r[z],s.hasOwnProperty(z)&&X!==J&&(X!=null||J!=null)&&(z==="selected"?e.selected=X&&typeof X!="function"&&typeof X!="symbol":Ye(e,n,z,X,s,J));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 Ce in r)X=r[Ce],r.hasOwnProperty(Ce)&&X!=null&&!s.hasOwnProperty(Ce)&&Ye(e,n,Ce,null,s,X);for(Y in s)if(X=s[Y],J=r[Y],s.hasOwnProperty(Y)&&X!==J&&(X!=null||J!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(i(137,n));break;default:Ye(e,n,Y,X,s,J)}return;default:if(Kc(n)){for(var $e in r)X=r[$e],r.hasOwnProperty($e)&&X!==void 0&&!s.hasOwnProperty($e)&&Rd(e,n,$e,void 0,s,X);for(ne in s)X=s[ne],J=r[ne],!s.hasOwnProperty(ne)||X===J||X===void 0&&J===void 0||Rd(e,n,ne,X,s,J);return}}for(var U in r)X=r[U],r.hasOwnProperty(U)&&X!=null&&!s.hasOwnProperty(U)&&Ye(e,n,U,null,s,X);for(oe in s)X=s[oe],J=r[oe],!s.hasOwnProperty(oe)||X===J||X==null&&J==null||Ye(e,n,oe,X,s,J)}function kv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function h2(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,r=performance.getEntriesByType("resource"),s=0;s<r.length;s++){var d=r[s],h=d.transferSize,x=d.initiatorType,_=d.duration;if(h&&_&&kv(x)){for(x=0,_=d.responseEnd,s+=1;s<r.length;s++){var z=r[s],Y=z.startTime;if(Y>_)break;var ne=z.transferSize,oe=z.initiatorType;ne&&kv(oe)&&(z=z.responseEnd,x+=ne*(z<_?1:(_-Y)/(z-Y)))}if(--s,n+=8*(h+x)/(d.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Od=null,Dd=null;function ml(e){return e.nodeType===9?e:e.ownerDocument}function Sv(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 Ev(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Md(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Ld=null;function g2(){var e=window.event;return e&&e.type==="popstate"?e===Ld?!1:(Ld=e,!0):(Ld=null,!1)}var Cv=typeof setTimeout=="function"?setTimeout:void 0,v2=typeof clearTimeout=="function"?clearTimeout:void 0,Tv=typeof Promise=="function"?Promise:void 0,y2=typeof queueMicrotask=="function"?queueMicrotask:typeof Tv<"u"?function(e){return Tv.resolve(null).then(e).catch(b2)}:Cv;function b2(e){setTimeout(function(){throw e})}function Da(e){return e==="head"}function Nv(e,n){var r=n,s=0;do{var d=r.nextSibling;if(e.removeChild(r),d&&d.nodeType===8)if(r=d.data,r==="/$"||r==="/&"){if(s===0){e.removeChild(d),fo(n);return}s--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")s++;else if(r==="html")Cs(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,Cs(r);for(var h=r.firstChild;h;){var x=h.nextSibling,_=h.nodeName;h[Po]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&h.rel.toLowerCase()==="stylesheet"||r.removeChild(h),h=x}}else r==="body"&&Cs(e.ownerDocument.body);r=d}while(r);fo(n)}function jv(e,n){var r=e;e=0;do{var s=r.nextSibling;if(r.nodeType===1?n?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(n?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=s}while(r)}function zd(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var r=n;switch(n=n.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":zd(r),Ic(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function w2(e,n,r,s){for(;e.nodeType===1;){var d=r;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Po])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var h=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=pn(e.nextSibling),e===null)break}return null}function x2(e,n,r){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=pn(e.nextSibling),e===null))return null;return e}function _v(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=pn(e.nextSibling),e===null))return null;return e}function Hd(e){return e.data==="$?"||e.data==="$~"}function Bd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function k2(e,n){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||r.readyState!=="loading")n();else{var s=function(){n(),r.removeEventListener("DOMContentLoaded",s)};r.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function pn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var Ud=null;function Av(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(n===0)return pn(e.nextSibling);n--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||n++}e=e.nextSibling}return null}function Rv(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(n===0)return e;n--}else r!=="/$"&&r!=="/&"||n++}e=e.previousSibling}return null}function Ov(e,n,r){switch(n=ml(r),e){case"html":if(e=n.documentElement,!e)throw Error(i(452));return e;case"head":if(e=n.head,!e)throw Error(i(453));return e;case"body":if(e=n.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Cs(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Ic(e)}var hn=new Map,Dv=new Set;function pl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var oa=P.d;P.d={f:S2,r:E2,D:C2,C:T2,L:N2,m:j2,X:A2,S:_2,M:R2};function S2(){var e=oa.f(),n=ol();return e||n}function E2(e){var n=Ar(e);n!==null&&n.tag===5&&n.type==="form"?Xh(n):oa.r(e)}var lo=typeof document>"u"?null:document;function Mv(e,n,r){var s=lo;if(s&&typeof n=="string"&&n){var d=sn(n);d='link[rel="'+e+'"][href="'+d+'"]',typeof r=="string"&&(d+='[crossorigin="'+r+'"]'),Dv.has(d)||(Dv.add(d),e={rel:e,crossOrigin:r,href:n},s.querySelector(d)===null&&(n=s.createElement("link"),yt(n,"link",e),ft(n),s.head.appendChild(n)))}}function C2(e){oa.D(e),Mv("dns-prefetch",e,null)}function T2(e,n){oa.C(e,n),Mv("preconnect",e,n)}function N2(e,n,r){oa.L(e,n,r);var s=lo;if(s&&e&&n){var d='link[rel="preload"][as="'+sn(n)+'"]';n==="image"&&r&&r.imageSrcSet?(d+='[imagesrcset="'+sn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(d+='[imagesizes="'+sn(r.imageSizes)+'"]')):d+='[href="'+sn(e)+'"]';var h=d;switch(n){case"style":h=co(e);break;case"script":h=uo(e)}hn.has(h)||(e=v({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:e,as:n},r),hn.set(h,e),s.querySelector(d)!==null||n==="style"&&s.querySelector(Ts(h))||n==="script"&&s.querySelector(Ns(h))||(n=s.createElement("link"),yt(n,"link",e),ft(n),s.head.appendChild(n)))}}function j2(e,n){oa.m(e,n);var r=lo;if(r&&e){var s=n&&typeof n.as=="string"?n.as:"script",d='link[rel="modulepreload"][as="'+sn(s)+'"][href="'+sn(e)+'"]',h=d;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=uo(e)}if(!hn.has(h)&&(e=v({rel:"modulepreload",href:e},n),hn.set(h,e),r.querySelector(d)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Ns(h)))return}s=r.createElement("link"),yt(s,"link",e),ft(s),r.head.appendChild(s)}}}function _2(e,n,r){oa.S(e,n,r);var s=lo;if(s&&e){var d=Rr(s).hoistableStyles,h=co(e);n=n||"default";var x=d.get(h);if(!x){var _={loading:0,preload:null};if(x=s.querySelector(Ts(h)))_.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":n},r),(r=hn.get(h))&&Wd(e,r);var z=x=s.createElement("link");ft(z),yt(z,"link",e),z._p=new Promise(function(Y,ne){z.onload=Y,z.onerror=ne}),z.addEventListener("load",function(){_.loading|=1}),z.addEventListener("error",function(){_.loading|=2}),_.loading|=4,hl(x,n,s)}x={type:"stylesheet",instance:x,count:1,state:_},d.set(h,x)}}}function A2(e,n){oa.X(e,n);var r=lo;if(r&&e){var s=Rr(r).hoistableScripts,d=uo(e),h=s.get(d);h||(h=r.querySelector(Ns(d)),h||(e=v({src:e,async:!0},n),(n=hn.get(d))&&Id(e,n),h=r.createElement("script"),ft(h),yt(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},s.set(d,h))}}function R2(e,n){oa.M(e,n);var r=lo;if(r&&e){var s=Rr(r).hoistableScripts,d=uo(e),h=s.get(d);h||(h=r.querySelector(Ns(d)),h||(e=v({src:e,async:!0,type:"module"},n),(n=hn.get(d))&&Id(e,n),h=r.createElement("script"),ft(h),yt(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},s.set(d,h))}}function Lv(e,n,r,s){var d=(d=me.current)?pl(d):null;if(!d)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=co(r.href),r=Rr(d).hoistableStyles,s=r.get(n),s||(s={type:"style",instance:null,count:0,state:null},r.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=co(r.href);var h=Rr(d).hoistableStyles,x=h.get(e);if(x||(d=d.ownerDocument||d,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,x),(h=d.querySelector(Ts(e)))&&!h._p&&(x.instance=h,x.state.loading=5),hn.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},hn.set(e,r),h||O2(d,e,r,x.state))),n&&s===null)throw Error(i(528,""));return x}if(n&&s!==null)throw Error(i(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=uo(r),r=Rr(d).hoistableScripts,s=r.get(n),s||(s={type:"script",instance:null,count:0,state:null},r.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function co(e){return'href="'+sn(e)+'"'}function Ts(e){return'link[rel="stylesheet"]['+e+"]"}function zv(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function O2(e,n,r,s){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?s.loading=1:(n=e.createElement("link"),s.preload=n,n.addEventListener("load",function(){return s.loading|=1}),n.addEventListener("error",function(){return s.loading|=2}),yt(n,"link",r),ft(n),e.head.appendChild(n))}function uo(e){return'[src="'+sn(e)+'"]'}function Ns(e){return"script[async]"+e}function Hv(e,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+sn(r.href)+'"]');if(s)return n.instance=s,ft(s),s;var d=v({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),ft(s),yt(s,"style",d),hl(s,r.precedence,e),n.instance=s;case"stylesheet":d=co(r.href);var h=e.querySelector(Ts(d));if(h)return n.state.loading|=4,n.instance=h,ft(h),h;s=zv(r),(d=hn.get(d))&&Wd(s,d),h=(e.ownerDocument||e).createElement("link"),ft(h);var x=h;return x._p=new Promise(function(_,z){x.onload=_,x.onerror=z}),yt(h,"link",s),n.state.loading|=4,hl(h,r.precedence,e),n.instance=h;case"script":return h=uo(r.src),(d=e.querySelector(Ns(h)))?(n.instance=d,ft(d),d):(s=r,(d=hn.get(h))&&(s=v({},r),Id(s,d)),e=e.ownerDocument||e,d=e.createElement("script"),ft(d),yt(d,"link",s),e.head.appendChild(d),n.instance=d);case"void":return null;default:throw Error(i(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(s=n.instance,n.state.loading|=4,hl(s,r.precedence,e));return n.instance}function hl(e,n,r){for(var s=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=s.length?s[s.length-1]:null,h=d,x=0;x<s.length;x++){var _=s[x];if(_.dataset.precedence===n)h=_;else if(h!==d)break}h?h.parentNode.insertBefore(e,h.nextSibling):(n=r.nodeType===9?r.head:r,n.insertBefore(e,n.firstChild))}function Wd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Id(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var gl=null;function Bv(e,n,r){if(gl===null){var s=new Map,d=gl=new Map;d.set(r,s)}else d=gl,s=d.get(r),s||(s=new Map,d.set(r,s));if(s.has(e))return s;for(s.set(e,null),r=r.getElementsByTagName(e),d=0;d<r.length;d++){var h=r[d];if(!(h[Po]||h[pt]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var x=h.getAttribute(n)||"";x=e+x;var _=s.get(x);_?_.push(h):s.set(x,[h])}}return s}function Uv(e,n,r){e=e.ownerDocument||e,e.head.insertBefore(r,n==="title"?e.querySelector("head > title"):null)}function D2(e,n,r){if(r===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(e=n.disabled,typeof n.precedence=="string"&&e==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Wv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function M2(e,n,r,s){if(r.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var d=co(s.href),h=n.querySelector(Ts(d));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=vl.bind(e),n.then(e,e)),r.state.loading|=4,r.instance=h,ft(h);return}h=n.ownerDocument||n,s=zv(s),(d=hn.get(d))&&Wd(s,d),h=h.createElement("link"),ft(h);var x=h;x._p=new Promise(function(_,z){x.onload=_,x.onerror=z}),yt(h,"link",s),r.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=vl.bind(e),n.addEventListener("load",r),n.addEventListener("error",r))}}var qd=0;function L2(e,n){return e.stylesheets&&e.count===0&&bl(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var s=setTimeout(function(){if(e.stylesheets&&bl(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&qd===0&&(qd=62500*h2());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&bl(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>qd?50:800)+n);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(d)}}:null}function vl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)bl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var yl=null;function bl(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,yl=new Map,n.forEach(z2,e),yl=null,vl.call(e))}function z2(e,n){if(!(n.state.loading&4)){var r=yl.get(e);if(r)var s=r.get(null);else{r=new Map,yl.set(e,r);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<d.length;h++){var x=d[h];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(r.set(x.dataset.precedence,x),s=x)}s&&r.set(null,s)}d=n.instance,x=d.getAttribute("data-precedence"),h=r.get(x)||s,h===s&&r.set(null,d),r.set(x,d),this.count++,s=vl.bind(this),d.addEventListener("load",s),d.addEventListener("error",s),h?h.parentNode.insertBefore(d,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),n.state.loading|=4}}var js={$$typeof:A,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function H2(e,n,r,s,d,h,x,_,z){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=Hc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hc(0),this.hiddenUpdates=Hc(null),this.identifierPrefix=s,this.onUncaughtError=d,this.onCaughtError=h,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function Iv(e,n,r,s,d,h,x,_,z,Y,ne,oe){return e=new H2(e,n,r,x,z,Y,ne,oe,_),n=1,h===!0&&(n|=24),h=Kt(3,null,null,n),e.current=h,h.stateNode=e,n=xu(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:s,isDehydrated:r,cache:n},Cu(h),e}function qv(e){return e?(e=Ir,e):Ir}function Pv(e,n,r,s,d,h){d=qv(d),s.context===null?s.context=d:s.pendingContext=d,s=ka(n),s.payload={element:r},h=h===void 0?null:h,h!==null&&(s.callback=h),r=Sa(e,s,n),r!==null&&(zt(r,e,n),ss(r,e,n))}function Fv(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<n?r:n}}function Pd(e,n){Fv(e,n),(e=e.alternate)&&Fv(e,n)}function Kv(e){if(e.tag===13||e.tag===31){var n=or(e,67108864);n!==null&&zt(n,e,67108864),Pd(e,67108864)}}function Yv(e){if(e.tag===13||e.tag===31){var n=Xt();n=Bc(n);var r=or(e,n);r!==null&&zt(r,e,n),Pd(e,n)}}var wl=!0;function B2(e,n,r,s){var d=M.T;M.T=null;var h=P.p;try{P.p=2,Fd(e,n,r,s)}finally{P.p=h,M.T=d}}function U2(e,n,r,s){var d=M.T;M.T=null;var h=P.p;try{P.p=8,Fd(e,n,r,s)}finally{P.p=h,M.T=d}}function Fd(e,n,r,s){if(wl){var d=Kd(s);if(d===null)Ad(e,n,s,xl,r),Vv(e,s);else if(I2(d,e,n,r,s))s.stopPropagation();else if(Vv(e,s),n&4&&-1<W2.indexOf(e)){for(;d!==null;){var h=Ar(d);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var x=er(h.pendingLanes);if(x!==0){var _=h;for(_.pendingLanes|=2,_.entangledLanes|=2;x;){var z=1<<31-Pt(x);_.entanglements[1]|=z,x&=~z}On(h),(Ie&6)===0&&(al=we()+500,ks(0))}}break;case 31:case 13:_=or(h,2),_!==null&&zt(_,h,2),ol(),Pd(h,2)}if(h=Kd(s),h===null&&Ad(e,n,s,xl,r),h===d)break;d=h}d!==null&&s.stopPropagation()}else Ad(e,n,s,null,r)}}function Kd(e){return e=$c(e),Yd(e)}var xl=null;function Yd(e){if(xl=null,e=_r(e),e!==null){var n=u(e);if(n===null)e=null;else{var r=n.tag;if(r===13){if(e=f(n),e!==null)return e;e=null}else if(r===31){if(e=p(n),e!==null)return e;e=null}else if(r===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return xl=e,null}function $v(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(at()){case In:return 2;case ke:return 8;case Re:case ve:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var $d=!1,Ma=null,La=null,za=null,_s=new Map,As=new Map,Ha=[],W2="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 Vv(e,n){switch(e){case"focusin":case"focusout":Ma=null;break;case"dragenter":case"dragleave":La=null;break;case"mouseover":case"mouseout":za=null;break;case"pointerover":case"pointerout":_s.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":As.delete(n.pointerId)}}function Rs(e,n,r,s,d,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:r,eventSystemFlags:s,nativeEvent:h,targetContainers:[d]},n!==null&&(n=Ar(n),n!==null&&Kv(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),e)}function I2(e,n,r,s,d){switch(n){case"focusin":return Ma=Rs(Ma,e,n,r,s,d),!0;case"dragenter":return La=Rs(La,e,n,r,s,d),!0;case"mouseover":return za=Rs(za,e,n,r,s,d),!0;case"pointerover":var h=d.pointerId;return _s.set(h,Rs(_s.get(h)||null,e,n,r,s,d)),!0;case"gotpointercapture":return h=d.pointerId,As.set(h,Rs(As.get(h)||null,e,n,r,s,d)),!0}return!1}function Gv(e){var n=_r(e.target);if(n!==null){var r=u(n);if(r!==null){if(n=r.tag,n===13){if(n=f(r),n!==null){e.blockedOn=n,cp(e.priority,function(){Yv(r)});return}}else if(n===31){if(n=p(r),n!==null){e.blockedOn=n,cp(e.priority,function(){Yv(r)});return}}else if(n===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function kl(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var r=Kd(e.nativeEvent);if(r===null){r=e.nativeEvent;var s=new r.constructor(r.type,r);Yc=s,r.target.dispatchEvent(s),Yc=null}else return n=Ar(r),n!==null&&Kv(n),e.blockedOn=r,!1;n.shift()}return!0}function Xv(e,n,r){kl(e)&&r.delete(n)}function q2(){$d=!1,Ma!==null&&kl(Ma)&&(Ma=null),La!==null&&kl(La)&&(La=null),za!==null&&kl(za)&&(za=null),_s.forEach(Xv),As.forEach(Xv)}function Sl(e,n){e.blockedOn===n&&(e.blockedOn=null,$d||($d=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,q2)))}var El=null;function Zv(e){El!==e&&(El=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){El===e&&(El=null);for(var n=0;n<e.length;n+=3){var r=e[n],s=e[n+1],d=e[n+2];if(typeof s!="function"){if(Yd(s||r)===null)continue;break}var h=Ar(r);h!==null&&(e.splice(n,3),n-=3,Ku(h,{pending:!0,data:d,method:r.method,action:s},s,d))}}))}function fo(e){function n(z){return Sl(z,e)}Ma!==null&&Sl(Ma,e),La!==null&&Sl(La,e),za!==null&&Sl(za,e),_s.forEach(n),As.forEach(n);for(var r=0;r<Ha.length;r++){var s=Ha[r];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Ha.length&&(r=Ha[0],r.blockedOn===null);)Gv(r),r.blockedOn===null&&Ha.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(s=0;s<r.length;s+=3){var d=r[s],h=r[s+1],x=d[At]||null;if(typeof h=="function")x||Zv(r);else if(x){var _=null;if(h&&h.hasAttribute("formAction")){if(d=h,x=h[At]||null)_=x.formAction;else if(Yd(d)!==null)continue}else _=x.action;typeof _=="function"?r[s+1]=_:(r.splice(s,3),s-=3),Zv(r)}}}function Qv(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(x){return d=x})},focusReset:"manual",scroll:"manual"})}function n(){d!==null&&(d(),d=null),s||setTimeout(r,20)}function r(){if(!s&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(r,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),d!==null&&(d(),d=null)}}}function Vd(e){this._internalRoot=e}Cl.prototype.render=Vd.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));var r=n.current,s=Xt();Pv(r,s,e,n,null,null)},Cl.prototype.unmount=Vd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Pv(e.current,2,null,e,null,null),ol(),n[jr]=null}};function Cl(e){this._internalRoot=e}Cl.prototype.unstable_scheduleHydration=function(e){if(e){var n=lp();e={blockedOn:null,target:e,priority:n};for(var r=0;r<Ha.length&&n!==0&&n<Ha[r].priority;r++);Ha.splice(r,0,e),r===0&&Gv(e)}};var Jv=a.version;if(Jv!=="19.2.5")throw Error(i(527,Jv,"19.2.5"));P.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=m(n),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var P2={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Tl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Tl.isDisabled&&Tl.supportsFiber)try{Wo=Tl.inject(P2),qt=Tl}catch{}}return Ds.createRoot=function(e,n){if(!l(e))throw Error(i(299));var r=!1,s="",d=sg,h=ig,x=lg;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(d=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(x=n.onRecoverableError)),n=Iv(e,1,!1,null,null,r,s,null,d,h,x,Qv),e[jr]=n.current,_d(e),new Vd(n)},Ds.hydrateRoot=function(e,n,r){if(!l(e))throw Error(i(299));var s=!1,d="",h=sg,x=ig,_=lg,z=null;return r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(x=r.onCaughtError),r.onRecoverableError!==void 0&&(_=r.onRecoverableError),r.formState!==void 0&&(z=r.formState)),n=Iv(e,1,!0,n,r??null,s,d,z,h,x,_,Qv),n.context=qv(null),r=n.current,s=Xt(),s=Bc(s),d=ka(s),d.callback=null,Sa(r,d,s),r=s,n.current.lanes=r,qo(n,r),On(n),e[jr]=n.current,_d(e),new Cl(n)},Ds.version="19.2.5",Ds}var cy;function eS(){if(cy)return Zd.exports;cy=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(a){console.error(a)}}return t(),Zd.exports=J2(),Zd.exports}var tS=eS();const nS="modulepreload",aS=function(t){return"/"+t},uy={},Nt=function(a,o,i){let l=Promise.resolve();if(o&&o.length>0){let g=function(m){return Promise.all(m.map(b=>Promise.resolve(b).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),p=f?.nonce||f?.getAttribute("nonce");l=g(o.map(m=>{if(m=aS(m),m in uy)return;uy[m]=!0;const b=m.endsWith(".css"),v=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${v}`))return;const k=document.createElement("link");if(k.rel=b?"stylesheet":nS,b||(k.as="script"),k.crossOrigin="",k.href=m,p&&k.setAttribute("nonce",p),document.head.appendChild(k),b)return new Promise((S,E)=>{k.addEventListener("load",S),k.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${m}`)))})}))}function u(f){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=f,window.dispatchEvent(p),!p.defaultPrevented)throw f}return l.then(f=>{for(const p of f||[])p.status==="rejected"&&u(p.reason);return a().catch(u)})},rS=y.lazy(()=>Nt(()=>import("./WorkspaceTaskDrawer-DOWlwBCm.js"),__vite__mapDeps([0,1])).then(t=>({default:t.WorkspaceTaskDrawer}))),oS=y.lazy(()=>Nt(()=>import("./AddWorkspaceFlow-BTYcc0tV.js"),[]).then(t=>({default:t.AddWorkspaceFlow}))),sS=y.lazy(()=>Nt(()=>import("./FirstRunWizard-Bdb1l71P.js"),[]).then(t=>({default:t.FirstRunWizard}))),iS=y.lazy(()=>Nt(()=>import("./WhatsNewDialog-rUU_Roz8.js"),[]).then(t=>({default:t.WhatsNewDialog}))),lS=({addDialogTrigger:t,onAddWorkspace:a,onCloseTaskGraph:o,onCloseWizard:i,onCreateWorkspace:l,onTryDemo:u,taskGraphOpen:f,tasksFile:p,wizardOpen:g,whatsNewOpen:m,whatsNewEntries:b,onCloseWhatsNew:v,workspacePath:k,workers:S,onSelectOwner:E,connectionStale:w})=>c.jsxs(c.Fragment,{children:[k?c.jsx(y.Suspense,{fallback:null,children:c.jsx(rS,{open:f,tasksFile:p,onClose:o,workspacePath:k,...S?{workers:S}:{},...E?{onSelectOwner:E}:{},...w!==void 0?{connectionStale:w}:{}})}):null,t>0?c.jsx(y.Suspense,{fallback:null,children:c.jsx(oS,{onClose:()=>{},onCreate:l,onTryDemo:u,trigger:t})}):null,g?c.jsx(y.Suspense,{fallback:null,children:c.jsx(sS,{open:g,onClose:i,onAddWorkspace:a,onTryDemo:u})}):null,m?c.jsx(y.Suspense,{fallback:null,children:c.jsx(iS,{open:m,entries:[...b],onClose:v})}):null]});const Gb=(...t)=>t.filter((a,o,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===o).join(" ").trim();const cS=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const uS=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,o,i)=>i?i.toUpperCase():o.toLowerCase());const dy=t=>{const a=uS(t);return a.charAt(0).toUpperCase()+a.slice(1)};var tf={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 dS=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1},fS=y.createContext({}),mS=()=>y.useContext(fS),pS=y.forwardRef(({color:t,size:a,strokeWidth:o,absoluteStrokeWidth:i,className:l="",children:u,iconNode:f,...p},g)=>{const{size:m=24,strokeWidth:b=2,absoluteStrokeWidth:v=!1,color:k="currentColor",className:S=""}=mS()??{},E=i??v?Number(o??b)*24/Number(a??m):o??b;return y.createElement("svg",{ref:g,...tf,width:a??m??tf.width,height:a??m??tf.height,stroke:t??k,strokeWidth:E,className:Gb("lucide",S,l),...!u&&!dS(p)&&{"aria-hidden":"true"},...p},[...f.map(([w,C])=>y.createElement(w,C)),...Array.isArray(u)?u:[u]])});const ye=(t,a)=>{const o=y.forwardRef(({className:i,...l},u)=>y.createElement(pS,{ref:u,iconNode:a,className:Gb(`lucide-${cS(dy(t))}`,`lucide-${t}`,i),...l}));return o.displayName=dy(t),o};const hS=[["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"}]],gc=ye("activity",hS);const gS=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],vS=ye("arrow-right",gS);const yS=[["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"}]],Pf=ye("bell",yS);const bS=[["path",{d:"M12 21V7",key:"gj6g52"}],["path",{d:"m16 12 2 2 4-4",key:"mdajum"}],["path",{d:"M22 6V4a1 1 0 0 0-1-1h-5a4 4 0 0 0-4 4 4 4 0 0 0-4-4H3a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h6a3 3 0 0 1 3 3 3 3 0 0 1 3-3h6a1 1 0 0 0 1-1v-1.3",key:"8arnkb"}]],wS=ye("book-open-check",bS);const xS=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],kS=ye("brain",xS);const SS=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ja=ye("check",SS);const ES=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],_o=ye("chevron-down",ES);const CS=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],TS=ye("chevron-left",CS);const NS=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],vc=ye("chevron-right",NS);const jS=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],_S=ye("chevrons-left",jS);const AS=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],RS=ye("chevrons-right",AS);const OS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Xb=ye("circle-check",OS);const DS=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],MS=ye("circle-play",DS);const LS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["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"}]],zS=ye("circle-question-mark",LS);const HS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],BS=ye("circle-x",HS);const US=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],WS=ye("circle",US);const IS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],qS=ye("clock-3",IS);const PS=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],FS=ye("code-xml",PS);const KS=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Nr=ye("copy",KS);const YS=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],Sm=ye("crown",YS);const $S=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],VS=ye("ellipsis-vertical",$S);const GS=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Em=ye("external-link",GS);const XS=[["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"}]],ZS=ye("eye",XS);const QS=[["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"}]],Zb=ye("file-text",QS);const JS=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],Gl=ye("flask-conical",JS);const eE=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["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"}]],Qb=ye("folder-plus",eE);const tE=[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]],nE=ye("hammer",tE);const aE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Jb=ye("info",aE);const rE=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],oE=ye("languages",rE);const sE=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],nf=ye("laptop",sE);const iE=[["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"}]],e0=ye("list-checks",iE);const lE=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Va=ye("loader-circle",lE);const cE=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],uE=ye("log-out",cE);const dE=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],fE=ye("maximize-2",dE);const mE=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],pE=ye("minimize-2",mE);const hE=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],gE=ye("package",hE);const vE=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],t0=ye("pencil",vE);const yE=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Ao=ye("play",yE);const bE=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Xl=ye("plus",bE);const wE=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],fy=ye("radio",wE);const xE=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Cm=ye("refresh-cw",xE);const kE=[["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"}]],Tm=ye("rotate-ccw",kE);const SE=[["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"}]],EE=ye("search-check",SE);const CE=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],TE=ye("send",CE);const NE=[["path",{d:"M6 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-2",key:"4b9dqc"}],["path",{d:"M6 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2",key:"22nnkd"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"m13 6-4 6h6l-4 6",key:"14hqih"}]],jE=ye("server-crash",NE);const _E=[["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"}]],Ff=ye("settings",_E);const AE=[["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"}]],RE=ye("shield-check",AE);const OE=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],DE=ye("sliders-horizontal",OE);const ME=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],n0=ye("smartphone",ME);const LE=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],a0=ye("sparkles",LE);const zE=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],r0=ye("square",zE);const HE=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],yc=ye("terminal",HE);const BE=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],bc=ye("trash-2",BE);const UE=[["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"}]],$s=ye("triangle-alert",UE);const WE=[["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"}]],af=ye("user-plus",WE);const IE=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],qE=ye("user-round",IE);const PE=[["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"}]],wc=ye("users",PE);const FE=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],Zl=ye("volume-2",FE);const KE=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],o0=ye("volume-x",KE);const YE=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],$E=ye("webhook",YE);const VE=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],s0=ye("workflow",VE);const GE=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ga=ye("x",GE),XE=t=>t==="en"||t==="zh",i0="hive.uiLanguage",l0={"addWorker.agentCli":"Agent CLI","addWorker.agentNotFound":"not found","addWorker.agentExists":"Member name already exists","addWorker.cancel":"Cancel","addWorker.create":"Add Member","addWorker.creating":"Creating…","addWorker.customPlaceholder":"You are a security reviewer focused on auth and input validation. Use team report to hand findings back to the orchestrator.","addWorker.description":"Pick a role and a CLI agent. The orchestrator dispatches work via {command}.","addWorker.enterName":"Enter a name","addWorker.genericAgent":"Generic command","addWorker.genericCommand":"startup command only","addWorker.loadingPresets":"Loading presets…","addWorker.name":"Name","addWorker.namePlaceholder":"e.g. Alice","addWorker.modifiedFrom":"Modified from {role} default","addWorker.pickCliOrStartup":"Pick a CLI agent or enter a startup command","addWorker.random":"Random","addWorker.randomAria":"Generate random member name","addWorker.randomTooltip":"Suggest a random name","addWorker.role":"Role","addWorker.roleInstructions":"Role instructions","addWorker.roleInstructionsTitle":"Injected into the agent's startup prompt and every dispatch. Hive's team protocol stays fixed; this only steers role behavior.","addWorker.reset":"Reset","addWorker.saveAsTemplate":"Save as template","addWorker.startupCommand":"Startup command","addWorker.startupHelp":"Optional. Runs through your shell in this Workspace (bash/zsh/fish on POSIX, cmd.exe on Windows). Use it for custom agents or native resume commands such as {example}.","addWorker.startupOverrides":"overrides CLI launch","addWorker.template":"Saved templates","addWorker.templateClear":"Use blank Custom (no template)","addWorker.templateDeleteAria":"Delete template {name}","addWorker.templateDeleteConfirm":'Delete the saved template "{name}"? This cannot be undone.',"addWorker.templateDeleteConfirmLabel":"Delete","addWorker.templateDeleteTitle":"Delete role template","addWorker.templateEmpty":"No saved templates yet. Fill in role instructions and save one.","addWorker.templateNamePlaceholder":"Template name","addWorker.templateNoMatch":"No templates match this search.","addWorker.templatePickPlaceholder":"Choose a saved template…","addWorker.templateSaveConfirm":"Save","addWorker.templateSearchPlaceholder":"Search templates","addWorker.title":"Add team member","addWorker.unavailable":"{name} is not installed","addWorker.emptyInstructions":"Add role instructions","actionCenter.activity.cancelled":"{worker} cancelled {ago}","actionCenter.activity.queued":"{worker} received work {ago}","actionCenter.activity.reported":"{worker} reported {ago}","actionCenter.activity.submitted":"{worker} started {ago}","actionCenter.attention":"Attention","actionCenter.attention.noWorkers":"No team members yet.","actionCenter.attention.remoteError":"Remote request errored at {endpoint}.","actionCenter.attention.remoteRejected":"Remote request rejected at {endpoint}: {reason}.","actionCenter.attention.stoppedWithQueue":"{worker} is stopped with open work.","actionCenter.attention.waitingReport":"{worker} has been waiting to report for {minutes}m.","actionCenter.attentionSubtitle":"Blocked or stale work that may need orchestration.","actionCenter.allClear":"All clear","actionCenter.collapse":"Collapse Action Center","actionCenter.copyRecap":"Copy recap","actionCenter.currentDispatch":"Current","actionCenter.expand":"Expand Action Center","actionCenter.latestReport":"Report","actionCenter.loadFailed":"Could not load team activity.","actionCenter.liveSnapshot":"Live snapshot","actionCenter.loading":"Loading team activity...","actionCenter.metrics":"Action Center metrics","actionCenter.needsAttention":"{count} need attention","actionCenter.noActivity":"No recent team activity.","actionCenter.noAttention":"No blocked work or remote errors right now.","actionCenter.noWorkerEvidence":"No active worker evidence.","actionCenter.openDispatches":"Open dispatches","actionCenter.recapCopied":"Recap copied to clipboard.","actionCenter.recapCopyFailed":"Could not copy recap.","actionCenter.recent":"Recent","actionCenter.recentReports":"Recent reports","actionCenter.recentSubtitle":"Dispatches, reports, and cancellations in order.","actionCenter.reportCount":"{count} reports","actionCenter.runningCount":"{count} running","actionCenter.subtitle":"Team activity, open dispatches, and evidence for the next orchestration move","actionCenter.terminalHint":"Terminal","actionCenter.title":"Action Center","actionCenter.totalWorkers":"Team members","actionCenter.unknownWorker":"Unknown member","actionCenter.updated":"Updated {ago}","actionCenter.workingWorkers":"Working now","actionCenter.workerStatus":"Status","actionCenter.workers":"Workers","actionCenter.workersSubtitle":"Current work, latest reports, and terminal hints.","common.cancel":"Cancel","common.close":"Close","common.dismiss":"Dismiss","common.never":"Never","common.error":"Error","common.closeDialog":"Close dialog","common.time.sAgo":"{count}s ago","common.time.mAgo":"{count}m ago","common.time.hAgo":"{count}h ago","common.time.dAgo":"{count}d ago","common.copied":"Copied","common.copyError":"Copy error","common.delete":"Delete","common.idle":"idle","common.loading":"Loading…","common.refresh":"Refresh","common.restart":"Restart","common.retry":"Retry","common.running":"running","common.save":"Save","common.saving":"Saving…","common.start":"Start","common.starting":"Starting…","common.stop":"Stop","common.stopped":"stopped","common.working":"working","connect.login.failed":"Sign-in failed — check your connection and try again.","connect.login.heading":"Connect to your Hive","connect.login.subtitle":"Sign in to reach the computers running Hive on your account.","connect.login.github":"Continue with GitHub","connect.login.google":"Continue with Google","connect.login.signingIn":"Signing in…","connect.machines.back":"Back","connect.machines.connecting":"Connecting…","connect.machines.heading":"Your computers","connect.machines.empty":"No computers yet. Run Hive on a computer and enable remote access.","connect.machines.lastSeen":"Last seen {ago} ago","connect.machines.manageDevices":"Manage devices","connect.machines.offline":"Offline","connect.machines.online":"Online","connect.machines.revoked":"Access revoked","connect.machines.revokedHint":"This device's access was revoked — enter a new pairing code to connect again.","connect.machines.select":"Connect","connect.pair.back":"Back","connect.pair.finalizing":"Confirmed — preparing your session…","connect.pair.guideHeading":"Pair this phone","connect.pair.guideStep1":"On that computer, open Settings → Remote access.","connect.pair.guideStep2":"Click Add device and keep the pairing code visible.","connect.pair.guideStep3":"Enter that pairing code below.","connect.pair.qrLabel":"Pairing code","connect.pair.sasInstruction":"On your computer, open Settings → Remote access and tap Confirm if this code matches.","connect.pair.sasPrompt":"Confirm this code matches the one shown on your computer:","connect.pair.startOver":"Start over","connect.pair.submit":"Pair","connect.error.selectFailed":"Couldn't reach that computer. Your saved session may have expired, or it's offline — pair again below.","connect.error.invalidCode":"That pairing code doesn't look right. Check it and try again.","demo.banner":"Demo mode — interactive product replay.","demo.exit":"Exit demo","demo.replaySubtitle":"A local replay of planning, dispatch, report, and task closure.","demo.replayTitle":"Hive demo workspace","demo.tasksTitle":"Task graph","demo.teamTitle":"Team","firstRun.addWorkspace":"Add Workspace","firstRun.back":"Back","firstRun.desc":"Coordinate multiple CLI coding agents — locally.","firstRun.getStarted":"Get started","firstRun.howItWorks":"How it works","firstRun.next":"Next","firstRun.optionDesc":"Choose how you want to begin.","firstRun.slide1Desc":"Pick a project folder.","firstRun.slide1Title":"Add a Workspace","firstRun.slide2Desc":"Antigravity CLI, Claude Code, Codex, Gemini, OpenCode, Hermes, Qwen Code, Pi — your choice.","firstRun.slide2Title":"Pick an Orchestrator","firstRun.slide3Desc":"The Orchestrator dispatches `team send <worker> <task>` to team members.","firstRun.slide3Title":"Dispatch tasks","firstRun.skip":"Skip","firstRun.skipForNow":"Skip for now","firstRun.step":"Step {current} of {total}","firstRun.subtitle":"Each Workspace runs an Orchestrator that dispatches tasks to team members.","firstRun.title":"Welcome to Hive","firstRun.tryDemo":"Try Demo","language.aria":"Switch language","language.currentEn":"EN","language.currentZh":"中","language.en":"EN","language.switchToEn":"Switch language to English","language.switchToZh":"Switch language to 中文","language.tooltip":"Language","language.zh":"中文","marketplace.allCategories":"All","marketplace.backToList":"Back to list","marketplace.close":"Close marketplace","marketplace.empty":"No matching agents","marketplace.importButton":"Fill into form","marketplace.importedBadge":"You have a saved template with this name","marketplace.loading":"Loading…","marketplace.imported":"Filled the form from {name}","marketplace.loadFailed":"Failed to load marketplace","marketplace.openFromAddWorker":"Browse marketplace","marketplace.searchPlaceholder":"Search agents…","marketplace.showAllCategories":"Show {count} more categories","marketplace.showCoreOnly":"Show core only","marketplace.sourceLabel":"Curated from {repo}","marketplace.title":"Template marketplace","marketplace.viewSource":"View on GitHub","mobile.nav.aria":"Main navigation","mobile.focus.enter":"Focus the terminal (hide navigation)","mobile.focus.exit":"Show navigation","mobile.nav.flows":"Flows","mobile.nav.more":"More","mobile.nav.settings":"Settings","mobile.nav.tasks":"Tasks","mobile.nav.team":"Team","mobile.reconnect.disconnected":"Disconnected.","mobile.reconnect.reconnecting":"Reconnecting…","mobile.reconnect.retry":"Retry","mobile.reconnect.revoked":"Access revoked — re-pair this device from your computer.","mobile.section.about":"About","mobile.section.demo":"Demo","mobile.section.devices":"Devices","mobile.section.settings":"Settings","mobile.section.workflows":"Workflows","mobile.section.workspaces":"Workspaces","mobile.tasks.noWorkspaceDesc":"Pick or add a workspace to see its task graph.","mobile.tasks.noWorkspaceTitle":"No workspace selected","mobile.team.orchestrator":"Orchestrator","mobile.team.workers":"Workers","mobile.workspaces.switch":"Switch workspace","openWorkspace.error.appNotInstalled":"Couldn't find {app}. Make sure it's installed and reachable.","openWorkspace.error.commandNotInPath":"Couldn't run the launcher for {app}. Add its CLI to your PATH and retry.","openWorkspace.error.invalidPath":"The workspace path contains characters that are unsafe to launch.","openWorkspace.error.invalidTarget":"That app is no longer a supported open target.","openWorkspace.error.unknown":"Couldn't open in {app}.","openWorkspace.noWorkspace":"Select a workspace to enable","openWorkspace.open":"Open","openWorkspace.opened":"Opened {workspace} in {app} on your computer","openWorkspace.openIn":"Open {workspace} in {app}","openWorkspace.openInAria":"Open workspace {workspace} in {app}","openWorkspace.selectTarget":"Choose app","openWorkspace.target.cursor":"Cursor","openWorkspace.target.finder.linux":"File Manager","openWorkspace.target.finder.mac":"Finder","openWorkspace.target.finder.windows":"File Explorer","openWorkspace.target.ghostty":"Ghostty","openWorkspace.target.terminal":"Terminal","openWorkspace.target.vscode":"VS Code","openWorkspace.target.vscodeInsiders":"VS Code Insiders","openWorkspace.target.zed":"Zed","packageUpdate.body":"You are running v{current}. Update when you are ready; Hive will keep running.","packageUpdate.commandCopied":"Command copied","packageUpdate.commandCopyFailed":"Could not copy command","packageUpdate.copyCommand":"Copy command","packageUpdate.later":"Later","packageUpdate.openRelease":"Open release notes","packageUpdate.release":"Release","packageUpdate.title":"Hive v{version} is available","orchestrator.copyErrorAria":"Copy error message","orchestrator.failed":"Orchestrator failed to start","orchestrator.removeWorkspace":"Remove workspace","orchestrator.start":"Start Orchestrator","orchestrator.stop":"Stop Orchestrator","orchestrator.startingDesc":"Preparing the Orchestrator terminal.","orchestrator.startingTitle":"Starting Orchestrator","orchestrator.stoppedDesc":"Start the Orchestrator to plan tasks and dispatch them to team members.","orchestrator.stoppedTitle":"Orchestrator is stopped","role.coder":"Coder","role.custom":"Custom","role.reviewer":"Reviewer","role.sentinel":"Sentinel","role.tester":"Tester","runtime.retryNow":"Retry now","runtime.staleBody":"Writes are paused until Hive reconnects to the local runtime.","runtime.staleTitle":"Hive runtime connection lost","runtime.writeDisabled":"Hive runtime connection lost; retry once it is back.","sidebar.deleteAria":"Delete Workspace {name}","sidebar.deleteConfirm":'Delete Workspace "{name}"?',"sidebar.deleteDescription":"This stops its agents and removes it from Hive. The folder on disk ({path}) is left untouched. {summary}.","sidebar.deleteFailed":"Failed to delete: {message}","sidebar.deleteLabel":"Delete Workspace","sidebar.deleting":"Deleting…","sidebar.dismissRepository":"Hide the GitHub link","sidebar.noMembers":"no team members yet","sidebar.newWorkspace":"New Workspace","sidebar.noWorkspaces":"No Workspaces","sidebar.noWorkspacesDesc":"Add one to start. Hive will load .hive/tasks.md and start the Orchestrator.","sidebar.oneWorking":"One team member working","sidebar.demoVideo":"Demo video","sidebar.openDemoVideo":"Watch the Hive demo video","sidebar.openRepository":"Open the Hive GitHub repository","sidebar.removed":'Removed Workspace "{name}".',"sidebar.teamMemberCount":"{count} team members","sidebar.workingCount":"{working} of {total} working","sidebar.workingMembers":"{count} team members working","sidebar.workspaces":"Workspaces","shellTerminal.closeFailed":"Failed to close shell: {message}","shellTerminal.open":"Terminal","shellTerminal.openAria":"Open workspace terminal","pairing.awaitingConfirm":"Confirm on your computer to finish pairing.","pairing.cancel":"Cancel","pairing.connecting":"Connecting to your computer…","pairing.failed.expired":"Pairing expired — start again.","pairing.failed.mintForbidden":"Pairing was not confirmed on your computer.","pairing.failed.rejected":"Pairing was rejected.","pairing.failed.socket":"Lost the connection before pairing finished.","pairing.failed.version":"This phone and computer are on different versions.","pairing.handshaking":"Verifying…","pairing.paired":"Paired.","pairing.sasPrompt":"Check that this code matches the one on your computer:","pwa.appShellUpdated":"Web UI updated","pwa.reloadToActivate":"Reload to activate","pwa.reloading":"Reloading…","pwa.runtimeOffline.autoReconnect":"Auto-reconnect on — Hive will reload when the runtime is back.","pwa.runtimeOffline.body":"Start the Hive daemon by running `hive` in a terminal.","pwa.runtimeOffline.retry":"Retry now","pwa.runtimeOffline.retrying":"Retrying…","pwa.runtimeOffline.title":"Hive runtime is not running","pwa.runtimeOffline.tryDemo":"Try Demo instead","pwa.waitForAgents":"Wait for agents to finish","remote.addDevice":"Add device","remote.audit.bytes":"{count} bytes","remote.audit.empty":"No remote activity yet.","remote.audit.heading":"Remote activity","remote.audit.hide":"Hide activity","remote.audit.loadFailed":"Could not load activity.","remote.audit.result.error":"error","remote.audit.result.ok":"ok","remote.audit.result.rejected":"rejected","remote.audit.show":"Show activity","remote.connect.connecting":"Connecting…","remote.connect.disconnected":"Disconnected","remote.connect.online":"Connected","remote.connect.reconnecting":"Reconnecting…","remote.connect.sessionExpired":"Session expired — sign in again.","remote.confirm.confirm":"Confirm","remote.confirm.confirming":"Confirming…","remote.confirm.description":"A phone is trying to pair as “{name}”. Compare this code with the one shown on the phone — they must match.","remote.confirm.expired":"Pairing request expired.","remote.confirm.failed":"Could not complete — try pairing again.","remote.confirm.paired":"Paired “{name}”.","remote.confirm.reject":"Reject","remote.confirm.rejected":"Pairing rejected.","remote.confirm.sasLabel":"Verification code","remote.confirm.title":"Confirm new device","remote.confirm.warning":"Only confirm if you started this and the codes match.","remote.devices.activeNow":"Active just now","remote.devices.empty":"No paired devices yet.","remote.devices.heading":"Paired devices","remote.devices.lastActive":"Active {ago} ago","remote.devices.loadFailed":"Could not load devices.","remote.devices.neverActive":"Not active yet","remote.devices.revoke":"Revoke","remote.devices.revokeAria":"Revoke device {name}","remote.devices.revokeConfirm":"Revoke “{name}”? Its open sessions close immediately and it must pair again.","remote.devices.revokeFailed":"Could not revoke — try again.","remote.devices.revokeTitle":"Revoke device","remote.devices.revoked":"Revoked “{name}”.","remote.diagnostics.copy":"Copy diagnostics","remote.diagnostics.copied":"Diagnostics copied","remote.diagnostics.copyFailed":"Could not copy diagnostics.","remote.diagnostics.copying":"Copying...","remote.retention.activeDays":"active days","remote.retention.loadFailed":"Could not load local retention signals.","remote.retention.localOnly":"local only","remote.retention.reports":"reports","remote.retention.sends":"sends","remote.retention.streak":"current streak","remote.retention.title":"Protocol activity","remote.disable.confirmBody":"Remote devices (including this one) will disconnect immediately. You can only re-enable it from the desktop.","remote.disable.confirmTitle":"Turn off remote access?","remote.enable.description":"Reach this machine from your phone over an end-to-end encrypted tunnel. Off by default.","remote.enable.label":"Remote access","remote.qr.cancel":"Cancel","remote.qr.expired":"Code expired — generate a new one.","remote.qr.expiresIn":"Expires in {seconds}s","remote.qr.instructions":"Enter this code on your phone. Keep this open until you confirm here.","remote.qr.regenerate":"New code","remote.qr.startFailed":"Could not start pairing — try again.","remote.qr.title":"Pairing code","remote.section":"Remote access","remote.status.connected":"Tunnel connected","remote.status.disconnected":"Tunnel offline","remote.status.linked":"Linked to {gateway}","remote.status.notLinked":"Not linked — run `hive remote login` in a terminal.","remote.status.connecting":"Connecting to the gateway…","remote.status.reconnecting":"Reconnecting…","remote.status.revoked":"Access revoked — re-link to restore remote access.","scenario.applied":"Team assembled — the goal is with the Orchestrator","scenario.apply":"Assemble team & start","scenario.applying":"Assembling…","scenario.build_review_test.desc":"Coder + Reviewer + Tester running a build–review–verify loop.","scenario.build_review_test.title":"Build · Review · Test","scenario.cancel":"Cancel","scenario.docs_pipeline.desc":"A drafter writes the doc, a doc reviewer checks facts and flow.","scenario.docs_pipeline.title":"Docs pipeline","scenario.goalHint":"Sent to the Orchestrator — it dispatches with team send/team spawn, or uses team workflow for staged or 3+ worker work.","scenario.goalLabel":"Goal","scenario.research_factcheck.desc":"A researcher gathers sourced findings, a fact-checker verifies them.","scenario.research_factcheck.title":"Research & Fact-check","scenario.sectionTitle":"Or start with a scenario team","settings.aria":"Settings","settings.autostaff.description":"Let the orchestrator size the team to each task — spawn the right mix of coders / testers / reviewers. On by default.","settings.autostaff.label":"Auto-staff team","settings.experimental":"Experimental","settings.language":"Language","settings.heading":"Settings","settings.notifications":"Notifications","settings.subtitle":"Features, webhooks, and remote access.","settings.saveError":"Could not save — check the runtime connection and try again.","settings.tooltip":"Settings","settings.webhook.description":"POST a small JSON payload to this URL when a worker reports or a workflow finishes — wire it to Slack, ntfy, Feishu, etc. Best-effort; the runtime sends to whatever URL you set, so keep it private.","settings.webhook.label":"Completion webhook","settings.webhook.saved":"Saved","settings.workflows.description":"Let the orchestrator author and run multi-agent workflows (`team workflow`). Off by default.","settings.workflows.label":"Workflows","topbar.hideTodo":"Hide Tasks","topbar.openWebsite":"Open hivehq.dev","topbar.showTodo":"Show Tasks (.hive/tasks.md)","topbar.todo":"Tasks","topbar.todoOpen":"Tasks — {count} open tasks","topbar.copyUpdateCommand":"Copy update command","topbar.openRelease":"Open release notes","topbar.updateAvailable":"Update available","topbar.updateCommandCopied":"Update command copied","topbar.updateCommandCopyFailed":"Could not copy update command","topbar.hideMemory":"Hide Memory","topbar.showMemory":"Show Memory","topbar.memory":"Memory","topbar.hideWorkflows":"Hide Workflows","topbar.showWorkflows":"Show Workflows","topbar.workflows":"Workflows","memory.title":"Memory","memory.subtitle":"Workspace knowledge, Dream runs, and injection controls","memory.searchPlaceholder":"Search...","memory.tabActive":"Active","memory.tabArchived":"Archived","memory.tabDreams":"Dreams","memory.runNow":"Run now","memory.injection":"Memory injection","memory.dreamProcessing":"Dream processing","memory.emptyActive":"No memory entries","memory.emptyActiveDesc":"Entries appear here after the orchestrator adds memory or Dream extracts it.","memory.emptyDreams":"No dream runs yet","memory.emptyDreamsDesc":"Run history appears after a manual or scheduled Dream pass.","memory.archiveTitle":"Archive Memory","memory.archiveDesc":"Archived memory stops appearing in startup, recovery, and dispatch injection.","memory.archiveButton":"Archive","memory.revertTitle":"Revert Dream Run","memory.revertDesc":"This restores the memory rows changed by the selected Dream run and archives entries it added.","memory.revertButton":"Revert","memory.sources":"Sources","memory.noSources":"No source evidence.","memory.updated":"Updated {time}","memory.injected":"Injected {time}","memory.started":"Started {time}","memory.finished":"Finished {time}","memory.revertTooltip":"Revert dream run","memory.status.pending":"pending","memory.status.running":"running","memory.status.completed":"completed","memory.status.failed":"failed","memory.status.reverted":"reverted","memory.trigger.manual":"manual","memory.trigger.cron":"scheduled","memory.trigger.scheduled":"scheduled","memory.noReport":"No report","memory.noInput":"No input","memory.seq":"Seq","memory.reportAdded":"added","memory.reportRewritten":"rewritten","memory.reportArchived":"archived","memory.reportMerged":"merged","memory.diff.added":"Added","memory.diff.rewritten":"Rewritten","memory.diff.archived":"Archived","memory.diff.merged":"Merged","memory.pinned":"Pinned","memory.scopeUser":"User","memory.disabled":"Disabled","memory.unpinTooltip":"Unpin","memory.pinTooltip":"Pin","memory.enableTooltip":"Enable","memory.disableTooltip":"Disable","memory.entries":"entries","memory.runs":"runs","memory.kind.decision":"Decision","memory.kind.fact":"Fact","memory.kind.pitfall":"Pitfall","memory.kind.preference":"Preference","memory.kind.procedure_ref":"Procedure","tasks.title":"Tasks","tasks.subtitle":"Project todo list parsed from .hive/tasks.md","tasks.editMarkdown":"Edit Markdown","tasks.save":"Save","tasks.local":"Keep Local","tasks.reload":"Reload","tasks.noTasks":"No task entries","tasks.noTasksDesc":"Orchestrators parse task items formatted as checkboxes from tasks.md.","workflows.title":"Workflows","workflows.subtitle":"Multi-agent workflows, dispatches, and logs","workflows.description":"Hive workflows are authored and run by the Orchestrator via team workflow run --stdin (recurring runs go through team workflow schedule). Native CLI subagents/workflows do not appear here; this panel observes Hive phases, workers, logs, and schedule controls.","workflows.recentRuns":"Recent runs","workflows.filterAll":"All","workflows.filterRunning":"Running","workflows.filterFailed":"Failed","workflows.emptyRuns":"No runs yet","workflows.emptyRunsDesc":"Ask the Orchestrator to run a Hive workflow for work that fans out across multiple workers.","workflows.emptyFilter":"No runs matching this filter.","workflows.schedules":"Schedules","workflows.noAgents":"No agent() calls in this run.","workflows.narrator":"Narrator ({count} lines)","workflows.narratorOne":"Narrator (1 line)","workflows.runError":"Run error: {error}","workflows.stopTooltip":"Stop run","workflows.deleteScheduleTooltip":"Delete schedule","workflows.pauseTooltip":"Pause","workflows.resumeTooltip":"Resume","workflows.loading":"Loading…","workflows.status.pending":"pending","workflows.status.running":"running","workflows.status.completed":"completed","workflows.status.failed":"failed","workflows.status.interrupted":"interrupted","workflows.status.stopped":"stopped","workflows.dispatchStatus.queued":"queued","workflows.dispatchStatus.submitted":"submitted","workflows.dispatchStatus.reported":"reported","workflows.dispatchStatus.cancelled":"cancelled","workflows.dispatchStatus.awaitingReport":"awaiting report…","workflows.cli.title":"Workflow agent CLI","workflows.cli.desc":"Which CLI a workflow agent launches when its script doesn't name one, and which CLIs are allowed. Custom role templates keep their own CLI.","workflows.cli.default":"Default","workflows.cli.allowed":"Allowed","workflows.cli.saving":"Saving…","workflows.cli.save":"Save","workflows.cli.pickOne":"Pick at least one CLI","workflows.cli.saved":"Saved","workflows.cli.failed":"Failed to save","welcome.addWorkspace":"Add your first Workspace","welcome.demo":"or try the demo (no install needed)","welcome.desc":"Coordinate Antigravity CLI, Claude Code, Codex, Gemini, OpenCode, Hermes, Qwen Code, Pi — locally.","welcome.step1Desc":"Pick a project folder.","welcome.step1Title":"Add a Workspace","welcome.step2Desc":"Antigravity / Claude / Codex / Gemini / OpenCode / Hermes / Qwen / Pi.","welcome.step2Title":"Choose an Orchestrator","welcome.step3Desc":"The Orchestrator routes work via team send.","welcome.step3Title":"Dispatch tasks","welcome.title":"Welcome to Hive","worker.deleteAria":"Delete team member {name}","worker.deleteConfirm":"Delete {name}?","worker.deleteDescription":"This stops {name}'s terminal and removes it from the workspace. All queued dispatches are dropped.","worker.deleteMember":"Delete member","worker.detail":"{name} detail","worker.closeOutsideHint":"Click outside the member window to close.","worker.emptyAdd":"Add your first member","worker.emptyDesc":"Add team members (Antigravity CLI, Claude Code, Codex, Gemini, OpenCode, Hermes, Qwen Code, Pi) and the Orchestrator will route tasks to them.","worker.emptyTitle":"No team members yet","worker.actionsAria":"Actions for {name}","worker.lastActivity":"Latest terminal output (a hint, not a reported reply).","worker.open":"Open {name}","worker.rename":"Rename","worker.renameAria":"Rename {name}","worker.restartAria":"Restart {name}","worker.renameDesc":"Pick a new display name. The agent's id and PTY are unchanged.","worker.renameFailed":"Rename failed: {message}","worker.renameSuccess":'Renamed to "{name}".',"worker.renameTitle":"Rename team member","worker.startAgent":"Start the agent to begin receiving dispatches.","worker.startAria":"Start {name}","worker.stopAria":"Stop {name}","worker.teamMembers":"Team members","worker.terminalNotStarted":"PTY not started yet — ","worker.terminalStopped":"PTY stopped — ","worker.widthResize":"Resize worker detail width","worker.workingLegend":"Working = busy or waiting for input. Hive doesn’t detect stalls automatically — open the terminal to check.","workerPane.resize":"Resize Orchestrator and Team Members panes","tasks.action.addSubtask":"Add subtask","tasks.action.backToList":"Back to list","tasks.action.closeTodo":"Close Tasks","tasks.action.copied":"Copied","tasks.action.copyLine":"Copy line","tasks.action.delete":"Delete","tasks.action.edit":"Edit","tasks.action.viewSource":"View source","tasks.aria.addSubtask":"Add subtask","tasks.aria.collapseSubtasks":"Collapse {count} subtasks","tasks.aria.copiedTaskLine":"Copied task line","tasks.aria.copyTaskLine":"Copy task line","tasks.aria.deleteTask":"Delete task","tasks.aria.drawer":"Tasks","tasks.aria.editTask":"Edit task","tasks.aria.expandSubtasks":"Expand {count} subtasks","tasks.aria.progress":"Task completion","tasks.button.addTask":"Add task","tasks.completed.toggle":"{count} completed","tasks.empty.description":"Ask the Orchestrator to split the work via team send/team spawn, or team workflow for staged or 3+ worker work — or add your first task to bootstrap .hive/tasks.md.","tasks.empty.title":"No tasks yet","tasks.placeholder.editTask":"Edit task","tasks.placeholder.newSubtask":"New subtask","tasks.placeholder.newTask":"What needs to be done?","tasks.progress.subtaskTitle":"{done} of {total} direct subtasks complete","tasks.raw.conflictDescription":"Reloading will discard the current draft; Keep local will continue editing it.","tasks.raw.conflictTitle":"File changed externally","tasks.raw.keepLocal":"Keep local","tasks.raw.label":"Tasks Markdown","tasks.raw.lineCount":"{count} lines","tasks.raw.reload":"Reload","tasks.raw.save":"Save tasks","tasks.title.todo":"Tasks","notifications.desktop.aria":"Browser notifications","notifications.desktop.helper":"Use system notifications when permission is granted.","notifications.desktop.label":"Browser notifications","notifications.desktop.unsupported":"Not supported in this browser.","notifications.detail.brief.description":"Compact status line","notifications.detail.brief.label":"Brief","notifications.detail.detailed.description":"Workspace and queue context","notifications.detail.detailed.label":"Detailed","notifications.detail.sectionLabel":"Information","notifications.settings.aria":"Notification settings","notifications.settings.heading":"Notifications","notifications.settings.subtitle":"Choose how Hive alerts you when team members report or stop.","notifications.settings.tooltip":"Notifications","notifications.sound.beacon.description":"Distinct question tone","notifications.sound.beacon.label":"Signal","notifications.sound.cascade.description":"Layered success tone","notifications.sound.cascade.label":"Cascade","notifications.sound.chime.description":"Clean glass tap","notifications.sound.chime.label":"Glass","notifications.sound.longerBadge":"longer","notifications.sound.off.description":"Mute sounds","notifications.sound.off.label":"Off","notifications.sound.ping.description":"Tiny UI tick","notifications.sound.ping.label":"Tap","notifications.sound.previewAria":"Preview {label} sound","notifications.sound.resolve.description":"Longer completion cue","notifications.sound.resolve.label":"Done","notifications.sound.sectionLabel":"Sound","notifications.sound.soft.description":"Warm default chime","notifications.sound.soft.label":"Soft","notifications.test.brief":"Hive notifications are working.","notifications.test.button":"Test","notifications.test.detail":"Hive notifications are working with your selected sound and detail level.","notifications.test.title":"Hive notification test","notifications.remoteSession.brief":"{name} connected","notifications.remoteSession.detail":"{name} established a remote session.","notifications.remoteSession.title":"Remote device connected","notifications.toast.blocked":"Browser notifications are blocked.","notifications.toast.declined":"Browser notifications were not enabled.","notifications.toast.unsupported":"This browser does not support notifications.","notifications.workerReported.brief":"{name} reported","notifications.workerReported.detail":"{name} reported in {workspace}.","notifications.workerReported.title":"Team member report","notifications.workerStarted.brief":"{name} started","notifications.workerStarted.detail":"{name} started in {workspace} as {role}.","notifications.workerStarted.title":"Team member started","notifications.workerStopped.brief":"{name} stopped","notifications.workerStopped.detail":"{name} stopped in {workspace}.","notifications.workerStopped.title":"Team member stopped","workspace.add.manualHint":"Type or paste the absolute path to a project folder on your computer.","workspace.advanced.browse":"Advanced: browse server filesystem","workspace.advanced.pastePath":"Advanced: paste path","workspace.advanced.settings":"Advanced Options","workspace.advanced.startup":"Advanced: custom startup command","workspace.browse.breadcrumb":"Breadcrumb","workspace.browse.drivesAria":"Show all drives","workspace.browse.drivesRoot":"This PC","workspace.browse.empty":"This directory is empty.","workspace.browse.gitBadge":"git","workspace.browse.openAria":"Open {name}","workspace.browse.parentAria":"Go to parent directory","workspace.browse.root":"root: {path}","workspace.browse.rootLoading":"(loading)","workspace.browse.selected":"Selected","workspace.browse.title":"Browse server filesystem","workspace.browse.up":"up","workspace.confirm.create":"Create Workspace","workspace.confirm.description":"Hive will load .hive/tasks.md and start the Orchestrator here.","workspace.confirm.title":"Add Workspace","workspace.error.createFailed":"Failed to create workspace","workspace.error.createTitle":"Could not create workspace","workspace.error.outsideSandbox":"Picked folder is not inside the Hive sandbox. Use paste path.","workspace.error.pastePathInstead":"Paste path instead","workspace.error.pickerFailed":"Folder picker failed","workspace.field.absolutePath":"Absolute path","workspace.field.absolutePathPlaceholder":"C:\\path\\to\\project or /absolute/path","workspace.field.name":"Workspace name","workspace.field.nameDefaultPlaceholder":"my-project","workspace.field.path":"Path","workspace.field.pathEmptyPlaceholder":"(no folder picked — use paste path below)","workspace.field.startup":"Startup command","workspace.field.startupPlaceholder":"claude --resume <session-id>","workspace.git.detached":"detached","workspace.git.detected":"git repository detected","workspace.git.none":"No git repository at this path.","workspace.git.noneShort":"no git","workspace.git.short":"git · {branch}","workspace.picking.message":"Opening system folder picker…","workspace.picking.title":"Opening folder picker","workspace.preset.label":"Orchestrator CLI","workspace.preset.generic":"Generic command","workspace.preset.genericPreview":"custom startup command only","workspace.preset.genericRequiresStartup":"Generic command requires a startup command.","workspace.preset.installCopy":"Copy","workspace.preset.installCopyAria":"Copy install command","workspace.preset.installDocs":"Install guide","workspace.preset.installHint":"Install {name}:","workspace.preset.loadFailed":"Failed to load CLI presets; using server default.","workspace.preset.loading":"Loading CLI presets…","workspace.preset.noneAvailable":"No supported CLI agent was found on this machine. You can watch the demo first — no install needed.","workspace.preset.notFoundSuffix":" (not found)","workspace.preset.notInstalled":"{name} is not installed. Choose another CLI or add a custom startup command.","workspace.preset.optionsAria":"Orchestrator CLI options","workspace.preset.pathHelpBody":"Hive detects CLIs using the PATH of the shell that launched it. With nvm or a GUI launcher, that PATH can differ from your terminal. Quit Hive and re-run `hive` from a terminal where this CLI works.","workspace.preset.pathHelpTitle":"Installed it, but still shown as not found?","workspace.preset.tryDemo":"Try the demo first","workspace.yolo.notice":"Agents start in auto-approve mode: CLI permission prompts are skipped (e.g. `--dangerously-skip-permissions`), so an agent can run commands and edit files as you. The Stop button on each card halts a runaway agent.","workspace.startup.hint":"Overrides the preset for this Orchestrator. Runs in the workspace directory through your shell (bash/zsh/fish on POSIX, cmd.exe on Windows), so only paste commands you trust.","workspace.startup.hintShort":"Runs through your shell in the workspace directory. Only paste commands you trust.","demo.orchestratorLabel":"Orchestrator — pre-recorded","demo.readOnlyBadge":"DEMO read-only","layout.sidebarAria":"Workspace sidebar","layout.sidebarResizeAria":"Resize Workspace sidebar","layout.sidebarCollapse":"Collapse sidebar","layout.sidebarExpand":"Expand sidebar","terminal.composer.placeholder":"Type a command…","terminal.composer.send":"Send","terminal.composer.sendEnter":"Send ⏎","terminal.paste.button":"Paste","terminal.paste.cancel":"Cancel","terminal.paste.confirm":"Paste","terminal.paste.denied":"Clipboard access was denied — long-press the input to paste instead.","terminal.paste.lengthChars":"{count} characters","terminal.paste.preview":"Preview","terminal.paste.title":"Paste into terminal?","terminal.renderer.canvasFallbackNotice":"WebGL unavailable — using the canvas renderer.","terminal.firstRunSetup":"Finish this CLI setup in the terminal, then Hive will send startup instructions.","terminal.scrollToBottom":"Jump to latest","terminal.statusConnecting":"Connecting","terminal.statusRunning":"Running","terminalPanel.closePanel":"Close terminal panel","terminalPanel.closeTab":"Close {name}","terminalPanel.maximize":"Maximize terminal panel","terminalPanel.newShell":"New shell","terminalPanel.resizeAria":"Resize terminal panel height","terminalPanel.restore":"Restore terminal panel","terminalPanel.tablistAria":"Workspace terminal tabs","terminalPanel.workerStopped":"{name} is stopped — start the member to attach a terminal.","terminalPanels.aria":"Terminal panels","toast.dismissAria":"Dismiss","whatsNew.gotIt":"Got it","whatsNew.subtitle":"Updates since you were last here","whatsNew.title":"What's New","whatsNew.versionLabel":"Version {version}","workspaceList.empty":"No Workspaces yet"},ZE={"addWorker.agentCli":"Agent CLI","addWorker.agentNotFound":"未找到","addWorker.agentExists":"成员名字已存在","addWorker.cancel":"取消","addWorker.create":"添加成员","addWorker.creating":"创建中…","addWorker.customPlaceholder":"你是安全审查成员,重点关注鉴权和输入校验。用 team report 把发现交还给 Orchestrator。","addWorker.description":"选择角色和 CLI Agent。Orchestrator 会通过 {command} 分派任务。","addWorker.emptyInstructions":"补充角色说明","addWorker.enterName":"请输入名称","addWorker.genericAgent":"通用命令","addWorker.genericCommand":"仅使用启动命令","addWorker.loadingPresets":"正在加载预设…","addWorker.name":"名称","addWorker.namePlaceholder":"例如 鲁班","addWorker.modifiedFrom":"已修改 {role} 默认说明","addWorker.pickCliOrStartup":"请选择 CLI Agent,或填写启动命令","addWorker.random":"随机","addWorker.randomAria":"生成随机成员名","addWorker.randomTooltip":"随机来一个","addWorker.role":"角色","addWorker.roleInstructions":"角色说明","addWorker.roleInstructionsTitle":"会注入到 Agent 启动提示和每次派单中。Hive 的 team 协议保持不变,这里只影响角色行为。","addWorker.reset":"重置","addWorker.saveAsTemplate":"保存为模板","addWorker.startupCommand":"启动命令","addWorker.startupHelp":"可选。会在当前 Workspace 里通过当前 shell 运行(POSIX 上是 bash/zsh/fish,Windows 上是 cmd.exe)。适合自定义 Agent 或原生命令恢复会话,例如 {example}。","addWorker.startupOverrides":"覆盖 CLI 启动","addWorker.template":"已保存的模板","addWorker.templateClear":"不使用模板(空白 Custom)","addWorker.templateDeleteAria":"删除模板 {name}","addWorker.templateDeleteConfirm":'删除已保存的模板"{name}"?该操作无法撤销。',"addWorker.templateDeleteConfirmLabel":"删除","addWorker.templateDeleteTitle":"删除角色模板","addWorker.templateEmpty":"还没有已保存的模板。在下方填写角色说明并保存。","addWorker.templateNamePlaceholder":"模板名称","addWorker.templateNoMatch":"没有匹配的模板。","addWorker.templatePickPlaceholder":"选择已保存的模板…","addWorker.templateSaveConfirm":"保存","addWorker.templateSearchPlaceholder":"搜索模板","addWorker.title":"添加团队成员","addWorker.unavailable":"{name} 未安装","actionCenter.activity.cancelled":"{worker} 已取消 · {ago}","actionCenter.activity.queued":"{worker} 已接收任务 · {ago}","actionCenter.activity.reported":"{worker} 已汇报 · {ago}","actionCenter.activity.submitted":"{worker} 已开始 · {ago}","actionCenter.attention":"注意","actionCenter.attention.noWorkers":"还没有团队成员。","actionCenter.attention.remoteError":"远程请求在 {endpoint} 出错。","actionCenter.attention.remoteRejected":"远程请求在 {endpoint} 被拒绝:{reason}。","actionCenter.attention.stoppedWithQueue":"{worker} 已停止,但还有未处理任务。","actionCenter.attention.waitingReport":"{worker} 已等待汇报 {minutes} 分钟。","actionCenter.attentionSubtitle":"可能需要 Orchestrator 处理的阻塞、等待或远程错误。","actionCenter.allClear":"状态正常","actionCenter.collapse":"收起 Action Center","actionCenter.copyRecap":"复制战报","actionCenter.currentDispatch":"当前","actionCenter.expand":"展开 Action Center","actionCenter.latestReport":"汇报","actionCenter.loadFailed":"无法加载团队动态。","actionCenter.liveSnapshot":"实时快照","actionCenter.loading":"正在加载团队动态...","actionCenter.metrics":"Action Center 指标","actionCenter.needsAttention":"{count} 项需关注","actionCenter.noActivity":"暂无团队动态。","actionCenter.noAttention":"当前没有阻塞任务或远程错误。","actionCenter.noWorkerEvidence":"暂无活跃成员证据。","actionCenter.openDispatches":"打开的任务","actionCenter.recapCopied":"战报已复制到剪贴板。","actionCenter.recapCopyFailed":"复制战报失败。","actionCenter.recent":"最近","actionCenter.recentReports":"近期汇报","actionCenter.recentSubtitle":"按时间排列的派发、汇报和取消记录。","actionCenter.reportCount":"{count} 条汇报","actionCenter.runningCount":"{count} 个运行中","actionCenter.subtitle":"团队动态、打开任务与下一步调度需要的证据","actionCenter.terminalHint":"终端","actionCenter.title":"Action Center","actionCenter.totalWorkers":"团队成员","actionCenter.unknownWorker":"未知成员","actionCenter.updated":"更新于 {ago}","actionCenter.workingWorkers":"正在工作","actionCenter.workerStatus":"状态","actionCenter.workers":"成员","actionCenter.workersSubtitle":"当前任务、最新汇报与终端线索。","common.cancel":"取消","common.close":"关闭","common.dismiss":"关闭提示","common.never":"从未","common.error":"错误","common.closeDialog":"关闭对话框","common.time.sAgo":"{count} 秒前","common.time.mAgo":"{count} 分钟前","common.time.hAgo":"{count} 小时前","common.time.dAgo":"{count} 天前","common.copied":"已复制","common.copyError":"复制错误","common.delete":"删除","common.idle":"空闲","common.loading":"加载中…","common.refresh":"刷新","common.restart":"重启","common.retry":"重试","common.running":"运行中","common.save":"保存","common.saving":"保存中…","common.start":"启动","common.starting":"启动中…","common.stop":"停止","common.stopped":"已停止","common.working":"工作中","connect.login.failed":"登录失败——请检查网络后重试。","connect.login.heading":"连接到你的 Hive","connect.login.subtitle":"登录后即可访问你账号下正在运行 Hive 的电脑。","connect.login.github":"使用 GitHub 登录","connect.login.google":"使用 Google 登录","connect.login.signingIn":"登录中…","connect.machines.back":"返回","connect.machines.connecting":"连接中…","connect.machines.heading":"你的电脑","connect.machines.empty":"还没有电脑。在电脑上运行 Hive 并开启远程访问。","connect.machines.lastSeen":"{ago}前在线","connect.machines.manageDevices":"管理设备","connect.machines.offline":"离线","connect.machines.online":"在线","connect.machines.revoked":"访问已被吊销","connect.machines.revokedHint":"此设备的访问已被吊销——请输入新的配对码重新连接。","connect.machines.select":"连接","connect.pair.back":"返回","connect.pair.finalizing":"已确认——正在准备会话…","connect.pair.guideHeading":"配对这台手机","connect.pair.guideStep1":"在那台电脑上,打开 设置 → 远程访问。","connect.pair.guideStep2":"点击添加设备,并保持配对码可见。","connect.pair.guideStep3":"在下面输入那个配对码。","connect.pair.qrLabel":"配对码","connect.pair.sasInstruction":"在你的电脑上,打开 设置 → 远程访问,确认验证码一致后点击确认。","connect.pair.sasPrompt":"确认此验证码与电脑上显示的一致:","connect.pair.startOver":"重新开始","connect.pair.submit":"配对","connect.error.selectFailed":"无法连接那台电脑。你保存的会话可能已失效,或它已离线 —— 请在下方重新配对。","connect.error.invalidCode":"这个配对码看起来不对,请检查后重试。","demo.banner":"演示模式 — 本地交互回放。","demo.exit":"退出演示","demo.replaySubtitle":"本地回放规划、派单、汇报和任务闭环。","demo.replayTitle":"Hive 演示工作区","demo.tasksTitle":"任务图","demo.teamTitle":"团队","firstRun.addWorkspace":"添加 Workspace","firstRun.back":"返回","firstRun.desc":"在本地协调多个 CLI 编码 Agent。","firstRun.getStarted":"开始使用","firstRun.howItWorks":"工作方式","firstRun.next":"下一步","firstRun.optionDesc":"选择一个开始方式。","firstRun.slide1Desc":"选择一个项目目录。","firstRun.slide1Title":"添加 Workspace","firstRun.slide2Desc":"Antigravity CLI、Claude Code、Codex、Gemini、OpenCode、Hermes、Qwen Code、Pi,任选。","firstRun.slide2Title":"选择 Orchestrator","firstRun.slide3Desc":"Orchestrator 通过 `team send <worker> <task>` 向团队成员派单。","firstRun.slide3Title":"分派任务","firstRun.skip":"跳过","firstRun.skipForNow":"暂时跳过","firstRun.step":"第 {current} / {total} 步","firstRun.subtitle":"每个 Workspace 运行一个 Orchestrator,再把任务派给团队成员。","firstRun.title":"欢迎使用 Hive","firstRun.tryDemo":"试用演示","language.aria":"切换语言","language.currentEn":"EN","language.currentZh":"中","language.en":"EN","language.switchToEn":"切换语言到 English","language.switchToZh":"切换语言到中文","language.tooltip":"语言","language.zh":"中文","marketplace.allCategories":"全部","marketplace.backToList":"返回列表","marketplace.close":"关闭模板市场","marketplace.empty":"没有匹配的角色","marketplace.importButton":"填入表单","marketplace.importedBadge":"本地已有同名模板","marketplace.loading":"加载中…","marketplace.imported":"已把 {name} 填入表单","marketplace.loadFailed":"加载失败","marketplace.openFromAddWorker":"从模板市场选择","marketplace.searchPlaceholder":"搜索角色…","marketplace.showAllCategories":"显示其他 {count} 个分类","marketplace.showCoreOnly":"只看核心分类","marketplace.sourceLabel":"由 {repo} 提供","marketplace.title":"模板市场","marketplace.viewSource":"在 GitHub 查看","mobile.nav.aria":"主导航","mobile.focus.enter":"专注终端(隐藏导航)","mobile.focus.exit":"显示导航","mobile.nav.flows":"工作流","mobile.nav.more":"更多","mobile.nav.settings":"设置","mobile.nav.tasks":"任务","mobile.nav.team":"团队","mobile.reconnect.disconnected":"已断开。","mobile.reconnect.reconnecting":"正在重新连接…","mobile.reconnect.retry":"重试","mobile.reconnect.revoked":"访问已被吊销——请在电脑上重新配对此设备。","mobile.section.about":"关于","mobile.section.demo":"演示","mobile.section.devices":"设备","mobile.section.settings":"设置","mobile.section.workflows":"工作流","mobile.section.workspaces":"工作区","mobile.tasks.noWorkspaceDesc":"选择或添加一个工作区即可查看其任务图。","mobile.tasks.noWorkspaceTitle":"未选择工作区","mobile.team.orchestrator":"Orchestrator","mobile.team.workers":"成员","mobile.workspaces.switch":"切换工作区","openWorkspace.error.appNotInstalled":"未找到 {app},请确认已安装并可启动。","openWorkspace.error.commandNotInPath":"{app} 的命令行入口不可用,请把它的 CLI 加入 PATH 后重试。","openWorkspace.error.invalidPath":"workspace 路径包含无法安全启动的字符。","openWorkspace.error.invalidTarget":"该应用已不在支持的打开目标列表里。","openWorkspace.error.unknown":"在 {app} 中打开失败。","openWorkspace.noWorkspace":"请先选择一个 workspace","openWorkspace.open":"打开","openWorkspace.opened":"已在你的电脑上用 {app} 打开 {workspace}","openWorkspace.openIn":"用 {app} 打开 {workspace}","openWorkspace.openInAria":"用 {app} 打开 workspace {workspace}","openWorkspace.selectTarget":"选择应用","openWorkspace.target.cursor":"Cursor","openWorkspace.target.finder.linux":"文件管理器","openWorkspace.target.finder.mac":"访达","openWorkspace.target.finder.windows":"文件资源管理器","openWorkspace.target.ghostty":"Ghostty","openWorkspace.target.terminal":"终端","openWorkspace.target.vscode":"VS Code","openWorkspace.target.vscodeInsiders":"VS Code Insiders","openWorkspace.target.zed":"Zed","packageUpdate.body":"当前运行的是 v{current}。准备好后再升级,Hive 会继续运行。","packageUpdate.commandCopied":"命令已复制","packageUpdate.commandCopyFailed":"复制命令失败","packageUpdate.copyCommand":"复制命令","packageUpdate.later":"稍后","packageUpdate.openRelease":"查看版本说明","packageUpdate.release":"版本说明","packageUpdate.title":"Hive v{version} 可用","orchestrator.copyErrorAria":"复制错误信息","orchestrator.failed":"Orchestrator 启动失败","orchestrator.removeWorkspace":"移除 workspace","orchestrator.start":"启动 Orchestrator","orchestrator.stop":"停止 Orchestrator","orchestrator.startingDesc":"正在准备 Orchestrator 终端。","orchestrator.startingTitle":"Orchestrator 启动中","orchestrator.stoppedDesc":"启动 Orchestrator 后才能规划任务并分派给团队成员。","orchestrator.stoppedTitle":"Orchestrator 已停止","role.coder":"开发","role.custom":"自定义","role.reviewer":"审查","role.sentinel":"巡检","role.tester":"测试","runtime.retryNow":"立即重试","runtime.staleBody":"重新连接本地后端前,写操作已暂停。","runtime.staleTitle":"Hive 后端连接已断开","runtime.writeDisabled":"Hive 后端连接已断开,恢复后再重试。","sidebar.deleteAria":"删除 Workspace {name}","sidebar.deleteConfirm":'删除 Workspace "{name}"?',"sidebar.deleteDescription":"这会停止其中的 Agent,并从 Hive 移除它。磁盘目录({path})不会被删除。{summary}。","sidebar.deleteFailed":"删除失败:{message}","sidebar.deleteLabel":"删除 Workspace","sidebar.deleting":"删除中…","sidebar.dismissRepository":"隐藏 GitHub 链接","sidebar.noMembers":"还没有团队成员","sidebar.newWorkspace":"新建 Workspace","sidebar.noWorkspaces":"还没有 Workspace","sidebar.noWorkspacesDesc":"添加一个开始使用。Hive 会加载 .hive/tasks.md 并启动 Orchestrator。","sidebar.oneWorking":"1 个团队成员工作中","sidebar.demoVideo":"演示视频","sidebar.openDemoVideo":"观看 Hive 演示视频","sidebar.openRepository":"打开 Hive GitHub 仓库","sidebar.removed":'已移除 Workspace "{name}"。',"sidebar.teamMemberCount":"{count} 个团队成员","sidebar.workingCount":"{working} / {total} 工作中","sidebar.workingMembers":"{count} 个团队成员工作中","sidebar.workspaces":"Workspaces","shellTerminal.closeFailed":"关闭 shell 失败:{message}","shellTerminal.open":"终端","shellTerminal.openAria":"打开 workspace 终端","pairing.awaitingConfirm":"在电脑上确认以完成配对。","pairing.cancel":"取消","pairing.connecting":"正在连接你的电脑…","pairing.failed.expired":"配对已过期——请重新开始。","pairing.failed.mintForbidden":"电脑端尚未确认此次配对。","pairing.failed.rejected":"配对被拒绝。","pairing.failed.socket":"配对完成前连接已断开。","pairing.failed.version":"手机与电脑版本不一致。","pairing.handshaking":"校验中…","pairing.paired":"已配对。","pairing.sasPrompt":"请核对此验证码与电脑上显示的一致:","pwa.appShellUpdated":"Web UI 已更新","pwa.reloadToActivate":"刷新以应用","pwa.reloading":"正在刷新…","pwa.runtimeOffline.autoReconnect":"已开启自动重连——后端恢复后会自动刷新。","pwa.runtimeOffline.body":"在终端运行 `hive` 启动后端。","pwa.runtimeOffline.retry":"立即重试","pwa.runtimeOffline.retrying":"重试中…","pwa.runtimeOffline.title":"Hive 后端未启动","pwa.runtimeOffline.tryDemo":"改试用演示","pwa.waitForAgents":"等待 Agent 完成","remote.addDevice":"添加设备","remote.audit.bytes":"{count} 字节","remote.audit.empty":"还没有远程活动。","remote.audit.heading":"远程活动","remote.audit.hide":"隐藏活动","remote.audit.loadFailed":"无法加载活动记录。","remote.audit.result.error":"错误","remote.audit.result.ok":"成功","remote.audit.result.rejected":"已拒绝","remote.audit.show":"查看活动","remote.connect.connecting":"连接中…","remote.connect.disconnected":"已断开","remote.connect.online":"已连接","remote.connect.reconnecting":"重连中…","remote.connect.sessionExpired":"会话已过期 —— 请重新登录。","remote.confirm.confirm":"确认","remote.confirm.confirming":"确认中…","remote.confirm.description":"一台手机正尝试以“{name}”配对。请把这个码和手机上显示的对比 —— 两者必须一致。","remote.confirm.expired":"配对请求已过期。","remote.confirm.failed":"无法完成 —— 请重新配对。","remote.confirm.paired":"已配对“{name}”。","remote.confirm.reject":"拒绝","remote.confirm.rejected":"已拒绝配对。","remote.confirm.sasLabel":"校验码","remote.confirm.title":"确认新设备","remote.confirm.warning":"仅在你发起配对且两个码一致时确认。","remote.devices.activeNow":"刚刚活跃","remote.devices.empty":"还没有已配对的设备。","remote.devices.heading":"已配对设备","remote.devices.lastActive":"{ago}前活跃","remote.devices.loadFailed":"无法加载设备列表。","remote.devices.neverActive":"尚未活跃","remote.devices.revoke":"吊销","remote.devices.revokeAria":"吊销设备 {name}","remote.devices.revokeConfirm":"吊销“{name}”?它的会话会立即断开,需要重新配对。","remote.devices.revokeFailed":"吊销失败 —— 请重试。","remote.devices.revokeTitle":"吊销设备","remote.devices.revoked":"已吊销“{name}”。","remote.diagnostics.copy":"复制诊断信息","remote.diagnostics.copied":"诊断信息已复制","remote.diagnostics.copyFailed":"无法复制诊断信息。","remote.diagnostics.copying":"正在复制...","remote.retention.activeDays":"活跃天数","remote.retention.loadFailed":"无法加载本地留存信号。","remote.retention.localOnly":"仅本地","remote.retention.reports":"汇报","remote.retention.sends":"派单","remote.retention.streak":"当前连续天数","remote.retention.title":"协议活动","remote.disable.confirmBody":"远程设备(包括本设备)将立即断开。只能在桌面端重新开启。","remote.disable.confirmTitle":"关闭远程访问?","remote.enable.description":"通过端到端加密隧道从手机访问这台机器。默认关闭。","remote.enable.label":"远程访问","remote.qr.cancel":"取消","remote.qr.expired":"配对码已过期 —— 请重新生成。","remote.qr.expiresIn":"{seconds} 秒后过期","remote.qr.instructions":"在手机上输入这个配对码。在这里确认前请保持打开。","remote.qr.regenerate":"重新生成","remote.qr.startFailed":"无法开始配对 —— 请重试。","remote.qr.title":"配对码","remote.section":"远程访问","remote.status.connected":"隧道已连接","remote.status.disconnected":"隧道离线","remote.status.linked":"已连接到 {gateway}","remote.status.notLinked":"未连接 —— 在终端运行 `hive remote login`。","remote.status.connecting":"正在连接网关…","remote.status.reconnecting":"正在重连…","remote.status.revoked":"访问已被吊销 —— 重新连接以恢复远程访问。","scenario.applied":"团队已组建,目标已交给 Orchestrator","scenario.apply":"组队并开工","scenario.applying":"组队中…","scenario.build_review_test.desc":"Coder + Reviewer + Tester,实现—审查—验证闭环。","scenario.build_review_test.title":"开发 · 审查 · 测试","scenario.cancel":"取消","scenario.docs_pipeline.desc":"起草成员成文,审稿成员核对事实与表达。","scenario.docs_pipeline.title":"文档流水线","scenario.goalHint":"将以你的名义发给 Orchestrator——由它拆解任务并用 team send 派单。","scenario.goalLabel":"目标","scenario.research_factcheck.desc":"调研员收集带出处的发现,核查员逐条复核。","scenario.research_factcheck.title":"调研与核查","scenario.sectionTitle":"或从场景一键组队","settings.aria":"设置","settings.autostaff.description":"让 Orchestrator 按任务自动配置团队规模,动态补充合适的开发、测试和审查成员。默认开启。","settings.autostaff.label":"自动组队","settings.experimental":"实验性功能","settings.language":"语言","settings.heading":"设置","settings.notifications":"通知","settings.subtitle":"功能开关、Webhook 和远程访问。","settings.saveError":"保存失败 —— 检查 runtime 连接后重试。","settings.tooltip":"设置","settings.webhook.description":"worker 汇报或 workflow 完成时,向此 URL POST 一小段 JSON —— 可接入 Slack、ntfy、飞书等。尽力投递;runtime 会发往你填的任意 URL,请妥善保管。","settings.webhook.label":"完成通知 Webhook","settings.webhook.saved":"已保存","settings.workflows.description":"允许 orchestrator 编写并运行多 agent 工作流(team workflow)。默认关闭。","settings.workflows.label":"工作流","topbar.hideTodo":"隐藏任务","topbar.openWebsite":"访问官网 hivehq.dev","topbar.showTodo":"显示任务 (.hive/tasks.md)","topbar.todo":"任务","topbar.todoOpen":"任务 — {count} 个未完成","topbar.copyUpdateCommand":"复制更新命令","topbar.openRelease":"查看版本","topbar.updateAvailable":"有新版本","topbar.updateCommandCopied":"已复制更新命令","topbar.updateCommandCopyFailed":"复制更新命令失败","topbar.hideMemory":"隐藏记忆","topbar.showMemory":"显示记忆","topbar.memory":"记忆","topbar.hideWorkflows":"隐藏工作流","topbar.showWorkflows":"显示工作流","topbar.workflows":"工作流","memory.title":"记忆","memory.subtitle":"工作区知识积累、Dream运行记录及注入配置","memory.searchPlaceholder":"搜索记忆...","memory.tabActive":"活跃中","memory.tabArchived":"已归档","memory.tabDreams":"Dream 运行记录","memory.runNow":"立即运行","memory.injection":"记忆注入","memory.dreamProcessing":"Dream 优化处理","memory.emptyActive":"暂无记忆条目","memory.emptyActiveDesc":"当 Orchestrator 添加记忆或 Dream 提取出知识后,此处会显示记录。","memory.emptyDreams":"暂无 Dream 运行记录","memory.emptyDreamsDesc":"在执行手动或定时的 Dream 优化后,此处将展示运行历史。","memory.archiveTitle":"归档记忆","memory.archiveDesc":"归档后的记忆将不再注入到启动、恢复以及 dispatch 阶段。","memory.archiveButton":"归档","memory.revertTitle":"撤销 Dream 运行","memory.revertDesc":"这将恢复由选定的 Dream 运行所修改的记忆行,并归档其新添加的条目。","memory.revertButton":"撤销","memory.sources":"来源证据","memory.noSources":"暂无来源证据。","memory.updated":"更新于 {time}","memory.injected":"注入于 {time}","memory.started":"启动于 {time}","memory.finished":"结束于 {time}","memory.revertTooltip":"撤销 Dream 运行效果","memory.status.pending":"待处理","memory.status.running":"进行中","memory.status.completed":"已完成","memory.status.failed":"已失败","memory.status.reverted":"已撤销","memory.trigger.manual":"手动触发","memory.trigger.cron":"定时计划","memory.trigger.scheduled":"定时计划","memory.noReport":"无报告","memory.noInput":"无输入","memory.seq":"序列号","memory.reportAdded":"新增","memory.reportRewritten":"已重写","memory.reportArchived":"已归档","memory.reportMerged":"已合并","memory.diff.added":"新增知识","memory.diff.rewritten":"重写知识","memory.diff.archived":"归档知识","memory.diff.merged":"合并知识","memory.pinned":"已置顶","memory.scopeUser":"用户偏好","memory.disabled":"已禁用","memory.unpinTooltip":"取消置顶","memory.pinTooltip":"置顶","memory.enableTooltip":"启用","memory.disableTooltip":"禁用","memory.entries":"条记录","memory.runs":"次运行记录","memory.kind.decision":"决议","memory.kind.fact":"事实","memory.kind.pitfall":"踩坑避雷","memory.kind.preference":"偏好","memory.kind.procedure_ref":"流程步骤","tasks.title":"任务清单","tasks.subtitle":"解析自项目内 .hive/tasks.md 的代办任务图","tasks.editMarkdown":"编辑 Markdown","tasks.save":"保存","tasks.local":"保留本地","tasks.reload":"重新加载","tasks.noTasks":"暂无任务条目","tasks.noTasksDesc":"Orchestrator 会从 tasks.md 中解析出复选框格式的任务项。","workflows.title":"工作流","workflows.subtitle":"多 Agent 工作流、分派任务与运行日志","workflows.description":"Hive 工作流由 Orchestrator 通过 team workflow run --stdin 编写并运行(循环任务会经过 team workflow schedule)。当前 CLI 内建的 subagent/workflow 不会出现在这里;此面板只观察 Hive 阶段、成员、日志和定时计划。","workflows.recentRuns":"最近运行","workflows.filterAll":"全部","workflows.filterRunning":"运行中","workflows.filterFailed":"已失败","workflows.emptyRuns":"暂无运行记录","workflows.emptyRunsDesc":"让 Orchestrator 为需要多个成员并行的任务启动 Hive workflow。","workflows.emptyFilter":"没有与此过滤条件匹配的运行记录。","workflows.schedules":"定时计划","workflows.noAgents":"本次运行没有调用任何 agent()。","workflows.narrator":"叙述器(共 {count} 行)","workflows.narratorOne":"叙述器(共 1 行)","workflows.runError":"运行错误:{error}","workflows.stopTooltip":"停止运行","workflows.deleteScheduleTooltip":"删除定时计划","workflows.pauseTooltip":"暂停","workflows.resumeTooltip":"恢复","workflows.loading":"加载中…","workflows.status.pending":"待处理","workflows.status.running":"运行中","workflows.status.completed":"已完成","workflows.status.failed":"已失败","workflows.status.interrupted":"已中断","workflows.status.stopped":"已停止","workflows.dispatchStatus.queued":"待派发","workflows.dispatchStatus.submitted":"提交中","workflows.dispatchStatus.reported":"已报告","workflows.dispatchStatus.cancelled":"已取消","workflows.dispatchStatus.awaitingReport":"等待报告…","workflows.cli.title":"工作流 Agent 运行环境 (CLI)","workflows.cli.desc":"设置工作流中未指定运行环境的 Agent 默认使用的 CLI,以及允许被工作流调用的 CLI 列表。自定义成员模板使用其自身的 CLI 设定。","workflows.cli.default":"默认运行环境","workflows.cli.allowed":"允许调用的环境","workflows.cli.saving":"保存中…","workflows.cli.save":"保存","workflows.cli.pickOne":"请至少选择一个 CLI","workflows.cli.saved":"保存成功","workflows.cli.failed":"保存失败","welcome.addWorkspace":"添加第一个 Workspace","welcome.demo":"或试用演示(无需安装 CLI)","welcome.desc":"在本地协调 Antigravity CLI、Claude Code、Codex、Gemini、OpenCode、Hermes、Qwen Code、Pi。","welcome.step1Desc":"选择一个项目目录。","welcome.step1Title":"添加 Workspace","welcome.step2Desc":"Antigravity / Claude / Codex / Gemini / OpenCode / Hermes / Qwen / Pi。","welcome.step2Title":"选择 Orchestrator","welcome.step3Desc":"Orchestrator 通过 team send 分派任务。","welcome.step3Title":"分派任务","welcome.title":"欢迎使用 Hive","worker.deleteAria":"删除团队成员 {name}","worker.deleteConfirm":"删除 {name}?","worker.deleteDescription":"这会停止 {name} 的终端,并从 workspace 中移除它。未处理任务会被丢弃。","worker.deleteMember":"删除成员","worker.detail":"{name} 详情","worker.closeOutsideHint":"点击成员窗口外任意区域关闭。","worker.emptyAdd":"添加第一个成员","worker.emptyDesc":"添加团队成员(Antigravity CLI、Claude Code、Codex、Gemini、OpenCode、Hermes、Qwen Code、Pi),Orchestrator 会分派任务。","worker.emptyTitle":"还没有团队成员","worker.actionsAria":"{name} 的操作","worker.lastActivity":"终端最新输出(仅供参考,不是汇报内容)。","worker.open":"打开 {name}","worker.rename":"重命名","worker.renameAria":"重命名 {name}","worker.restartAria":"重启 {name}","worker.renameDesc":"选择新的显示名称。Agent id 和终端不会变化。","worker.renameFailed":"重命名失败:{message}","worker.renameSuccess":'已重命名为 "{name}"。',"worker.renameTitle":"重命名团队成员","worker.startAgent":"启动 Agent 后即可接收派单。","worker.startAria":"启动 {name}","worker.stopAria":"停止 {name}","worker.teamMembers":"团队成员","worker.terminalNotStarted":"终端未启动 — ","worker.terminalStopped":"终端已停止 — ","worker.widthResize":"调整成员详情宽度","worker.workingLegend":"工作中 = 忙碌或等待输入。Hive 不会自动检测卡死 —— 打开终端查看。","workerPane.resize":"调整 Orchestrator 和团队成员面板宽度","tasks.action.addSubtask":"添加子任务","tasks.action.backToList":"返回列表","tasks.action.closeTodo":"关闭任务清单","tasks.action.copied":"已复制","tasks.action.copyLine":"复制行","tasks.action.delete":"删除","tasks.action.edit":"编辑","tasks.action.viewSource":"查看源码","tasks.aria.addSubtask":"添加子任务","tasks.aria.collapseSubtasks":"折叠 {count} 个子任务","tasks.aria.copiedTaskLine":"已复制任务行","tasks.aria.copyTaskLine":"复制任务行","tasks.aria.deleteTask":"删除任务","tasks.aria.drawer":"任务清单","tasks.aria.editTask":"编辑任务","tasks.aria.expandSubtasks":"展开 {count} 个子任务","tasks.aria.progress":"任务完成度","tasks.button.addTask":"添加任务","tasks.completed.toggle":"{count} 个已完成","tasks.empty.description":"让 Orchestrator 拆分任务并用 team send/team spawn 派给成员,或手动加第一条任务来创建 .hive/tasks.md。","tasks.empty.title":"还没有任务","tasks.placeholder.editTask":"编辑任务","tasks.placeholder.newSubtask":"新建子任务","tasks.placeholder.newTask":"下一步要做什么?","tasks.progress.subtaskTitle":"已完成 {done} / {total} 个直接子任务","tasks.raw.conflictDescription":"重新载入会丢弃当前草稿;保留本地会继续编辑当前内容。","tasks.raw.conflictTitle":"文件已在外部变化","tasks.raw.keepLocal":"保留本地","tasks.raw.label":"任务 Markdown","tasks.raw.lineCount":"{count} 行","tasks.raw.reload":"重新载入","tasks.raw.save":"保存任务","tasks.title.todo":"任务","notifications.desktop.aria":"浏览器通知","notifications.desktop.helper":"授权后使用系统通知。","notifications.desktop.label":"浏览器通知","notifications.desktop.unsupported":"此浏览器不支持。","notifications.detail.brief.description":"一行状态摘要","notifications.detail.brief.label":"简略","notifications.detail.detailed.description":"包含 Workspace 和队列信息","notifications.detail.detailed.label":"详细","notifications.detail.sectionLabel":"信息","notifications.settings.aria":"通知设置","notifications.settings.heading":"通知","notifications.settings.subtitle":"选择团队成员汇报或停止时 Hive 的提醒方式。","notifications.settings.tooltip":"通知","notifications.sound.beacon.description":"清晰的提示音","notifications.sound.beacon.label":"信号","notifications.sound.cascade.description":"层次更丰富的完成音","notifications.sound.cascade.label":"瀑布","notifications.sound.chime.description":"干净的玻璃轻点","notifications.sound.chime.label":"玻璃","notifications.sound.longerBadge":"更长","notifications.sound.off.description":"静音","notifications.sound.off.label":"关闭","notifications.sound.ping.description":"很短的界面轻点","notifications.sound.ping.label":"轻点","notifications.sound.previewAria":"试听 {label} 声音","notifications.sound.resolve.description":"更长的完成提示","notifications.sound.resolve.label":"完成","notifications.sound.sectionLabel":"声音","notifications.sound.soft.description":"温和的默认提示","notifications.sound.soft.label":"轻柔","notifications.test.brief":"Hive 通知正常工作。","notifications.test.button":"测试","notifications.test.detail":"Hive 通知按你选择的声音和详情级别正常工作。","notifications.test.title":"Hive 通知测试","notifications.remoteSession.brief":"{name} 已连接","notifications.remoteSession.detail":"{name} 建立了远程会话。","notifications.remoteSession.title":"远程设备已连接","notifications.toast.blocked":"浏览器通知被屏蔽。","notifications.toast.declined":"未启用浏览器通知。","notifications.toast.unsupported":"此浏览器不支持通知。","notifications.workerReported.brief":"{name} 已汇报","notifications.workerReported.detail":"{name} 已在 {workspace} 汇报。","notifications.workerReported.title":"团队成员汇报","notifications.workerStarted.brief":"{name} 已启动","notifications.workerStarted.detail":"{name} 已在 {workspace} 以 {role} 角色启动。","notifications.workerStarted.title":"团队成员已启动","notifications.workerStopped.brief":"{name} 已停止","notifications.workerStopped.detail":"{name} 已在 {workspace} 停止。","notifications.workerStopped.title":"团队成员已停止","workspace.add.manualHint":"输入或粘贴你电脑上某个项目文件夹的绝对路径。","workspace.advanced.browse":"高级:浏览服务器文件系统","workspace.advanced.pastePath":"高级:粘贴路径","workspace.advanced.settings":"高级选项","workspace.advanced.startup":"高级:自定义启动命令","workspace.browse.breadcrumb":"面包屑","workspace.browse.drivesAria":"显示所有磁盘","workspace.browse.drivesRoot":"此电脑","workspace.browse.empty":"此目录为空。","workspace.browse.gitBadge":"git","workspace.browse.openAria":"打开 {name}","workspace.browse.parentAria":"返回上级目录","workspace.browse.root":"根目录:{path}","workspace.browse.rootLoading":"(加载中)","workspace.browse.selected":"已选择","workspace.browse.title":"浏览服务器文件系统","workspace.browse.up":"上级","workspace.confirm.create":"创建 Workspace","workspace.confirm.description":"Hive 会在此加载 .hive/tasks.md 并启动 Orchestrator。","workspace.confirm.title":"添加 Workspace","workspace.error.createFailed":"创建 Workspace 失败","workspace.error.createTitle":"无法创建 Workspace","workspace.error.outsideSandbox":"所选目录不在 Hive 沙盒内,请改用粘贴路径。","workspace.error.pastePathInstead":"改为粘贴路径","workspace.error.pickerFailed":"目录选择失败","workspace.field.absolutePath":"绝对路径","workspace.field.absolutePathPlaceholder":"C:\\path\\to\\project 或 /absolute/path","workspace.field.name":"Workspace 名称","workspace.field.nameDefaultPlaceholder":"my-project","workspace.field.path":"路径","workspace.field.pathEmptyPlaceholder":"(未选择目录 — 请使用下方粘贴路径)","workspace.field.startup":"启动命令","workspace.field.startupPlaceholder":"claude --resume <session-id>","workspace.git.detached":"游离 HEAD","workspace.git.detected":"检测到 git 仓库","workspace.git.none":"此路径下没有 git 仓库。","workspace.git.noneShort":"无 git","workspace.git.short":"git · {branch}","workspace.picking.message":"正在打开系统目录选择器…","workspace.picking.title":"正在打开目录选择器","workspace.preset.label":"Orchestrator CLI","workspace.preset.generic":"通用命令","workspace.preset.genericPreview":"仅使用自定义启动命令","workspace.preset.genericRequiresStartup":"通用命令需要填写启动命令。","workspace.preset.installCopy":"复制","workspace.preset.installCopyAria":"复制安装命令","workspace.preset.installDocs":"安装指南","workspace.preset.installHint":"安装 {name}:","workspace.preset.loadFailed":"加载 CLI 预设失败,使用服务器默认值。","workspace.preset.loading":"正在加载 CLI 预设…","workspace.preset.noneAvailable":"本机未检测到任何支持的 CLI agent。可以先看演示,无需安装。","workspace.preset.notFoundSuffix":"(未找到)","workspace.preset.notInstalled":"{name} 未安装。请选择其他 CLI 或填写启动命令。","workspace.preset.optionsAria":"Orchestrator CLI 选项","workspace.preset.pathHelpBody":"Hive 用启动它的那个 shell 的 PATH 探测 CLI。使用 nvm 或从图形界面启动时,该 PATH 可能与你的终端不同。请退出 Hive,在装有该 CLI 的终端里重新运行 `hive`。","workspace.preset.pathHelpTitle":"装了却显示未找到?","workspace.preset.tryDemo":"先看演示","workspace.yolo.notice":"Agent 默认以自动批准模式运行:CLI 的权限确认会被跳过(如 `--dangerously-skip-permissions`),agent 可以像你本人一样执行命令、修改文件。每张卡片上的 Stop 按钮可随时叫停失控的 agent。","workspace.startup.hint":"覆盖该 Orchestrator 的预设。通过当前 shell(POSIX 上是 bash/zsh/fish,Windows 上是 cmd.exe)在 Workspace 目录中运行,请只粘贴你信任的命令。","workspace.startup.hintShort":"通过当前 shell 在 Workspace 目录中运行。请只粘贴你信任的命令。","demo.orchestratorLabel":"Orchestrator — 预录数据","demo.readOnlyBadge":"演示 只读","layout.sidebarAria":"Workspace 侧栏","layout.sidebarResizeAria":"调整 Workspace 侧栏宽度","layout.sidebarCollapse":"收起侧栏","layout.sidebarExpand":"展开侧栏","terminal.composer.placeholder":"输入命令…","terminal.composer.send":"发送","terminal.composer.sendEnter":"发送 ⏎","terminal.paste.button":"粘贴","terminal.paste.cancel":"取消","terminal.paste.confirm":"粘贴","terminal.paste.denied":"剪贴板访问被拒绝——请长按输入框粘贴。","terminal.paste.lengthChars":"共 {count} 个字符","terminal.paste.preview":"预览","terminal.paste.title":"粘贴到终端?","terminal.renderer.canvasFallbackNotice":"WebGL 不可用——已改用 canvas 渲染器。","terminal.firstRunSetup":"请先在终端完成该 CLI 的首次设置,随后 Hive 会发送启动指令。","terminal.scrollToBottom":"回到底部","terminal.statusConnecting":"连接中","terminal.statusRunning":"运行中","terminalPanel.closePanel":"关闭终端面板","terminalPanel.closeTab":"关闭 {name}","terminalPanel.maximize":"最大化终端面板","terminalPanel.newShell":"新建 shell","terminalPanel.resizeAria":"调整终端面板高度","terminalPanel.restore":"还原终端面板","terminalPanel.tablistAria":"Workspace 终端标签","terminalPanel.workerStopped":"{name} 已停止——启动该成员后会自动连接终端。","terminalPanels.aria":"终端面板","toast.dismissAria":"关闭","whatsNew.gotIt":"知道了","whatsNew.subtitle":"上次使用以来的更新","whatsNew.title":"更新内容","whatsNew.versionLabel":"版本 {version}","workspaceList.empty":"还没有 Workspace"},QE={en:l0,zh:ZE},JE=()=>{if(typeof window>"u")return"en";const t=eC();return t||(window.navigator.language.toLowerCase().startsWith("zh")?"zh":"en")},eC=()=>{try{const t=window.localStorage.getItem(i0);return XE(t)?t:null}catch{return null}},tC=t=>{try{window.localStorage.setItem(i0,t)}catch{}},c0=t=>(a,o={})=>(QE[t][a]??l0[a]??a).replace(/\{(\w+)\}/g,(l,u)=>{const f=o[u];return f===void 0?l:String(f)}),nC={language:"en",setLanguage:()=>{},t:c0("en")},u0=y.createContext(nC),aC=({children:t})=>{const[a,o]=y.useState(JE),i=y.useMemo(()=>({language:a,setLanguage:u=>{o(u),tC(u)},t:c0(a)}),[a]);return c.jsx(u0.Provider,{value:i,children:t})},Se=()=>y.useContext(u0),rC=({onExit:t})=>{const{t:a}=Se();return c.jsxs("section",{"aria-label":"Demo mode","data-testid":"demo-banner",className:"flex shrink-0 items-center justify-between border-b px-4 py-2 text-xs",style:{background:"var(--status-yellow-bg, #3a2c1c)",borderColor:"var(--border)"},children:[c.jsxs("div",{className:"flex items-center gap-2 text-pri",children:[c.jsx(a0,{size:14,"aria-hidden":!0}),c.jsx("span",{children:a("demo.banner")})]}),c.jsx("button",{type:"button",onClick:t,className:"icon-btn icon-btn--ghost",children:a("demo.exit")})]})},Nl=[{label:"Plan",terminal:["$ hive demo","Orchestrator: turning the request into .hive/tasks.md","$ team spawn coder --name ada-lovelace","$ team spawn reviewer --name socrates"],doneTasks:1,workerStates:["idle","idle"]},{label:"Dispatch",terminal:['$ team send ada-lovelace "Implement POST /todos with SQLite persistence"',"Hive: dispatch queued and delivered to ada-lovelace","ada-lovelace: editing src/routes/todos.ts"],doneTasks:2,workerStates:["working","idle"]},{label:"Report",terminal:['ada-lovelace: team report "POST /todos implemented; tests added"',"Orchestrator: marking implementation done, sending review",'$ team send socrates "Review todo endpoint and tests"'],doneTasks:3,workerStates:["idle","working"]},{label:"Close",terminal:['socrates: team report "No blocker; one naming nit fixed"',"Orchestrator: validation complete","tasks.md: all demo tasks checked"],doneTasks:5,workerStates:["idle","idle"]}],rf=["Create the Todo API route","Persist todos in SQLite","Add Vitest coverage","Review route behavior","Mark .hive/tasks.md complete"],oC=[{name:"ada-lovelace",role:"Coder"},{name:"socrates",role:"Reviewer"}],sC=({onExit:t})=>{const{t:a}=Se(),[o,i]=y.useState(0);y.useEffect(()=>{const f=window.setInterval(()=>{i(p=>(p+1)%Nl.length)},1800);return()=>window.clearInterval(f)},[]);const l=Nl[o]??Nl[0],u=y.useMemo(()=>Nl.slice(0,o+1).flatMap(f=>f.terminal),[o]);return c.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[c.jsx(rC,{onExit:t}),c.jsx("div",{className:"scroll-y min-h-0 flex-1 px-4 py-4",style:{background:"var(--bg-2)"},children:c.jsxs("section",{className:"mx-auto grid h-full min-h-[520px] w-full max-w-6xl gap-3 lg:grid-cols-[minmax(0,1.35fr)_minmax(320px,0.65fr)]","data-testid":"demo-replay-panel",children:[c.jsxs("div",{className:"flex min-h-0 flex-col rounded-md border bg-0",children:[c.jsxs("header",{className:"flex items-center justify-between border-b px-3 py-2",style:{borderColor:"var(--border)"},children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx(yc,{size:15,className:"text-accent"}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("h1",{className:"truncate text-sm font-semibold text-pri",children:a("demo.replayTitle")}),c.jsx("p",{className:"text-xs text-ter",children:a("demo.replaySubtitle")})]})]}),c.jsx("span",{className:"rounded border px-2 py-1 text-[11px] text-sec",children:l.label})]}),c.jsx("pre",{className:"mono min-h-0 flex-1 overflow-auto whitespace-pre-wrap p-4 text-xs leading-6 text-sec","data-testid":"demo-replay-terminal",children:u.join(`
|
|
11
|
-
`)})]}),c.jsxs("aside",{className:"flex min-h-0 flex-col gap-3",children:[c.jsxs("div",{className:"rounded-md border bg-0 p-3","data-testid":"demo-task-graph",children:[c.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[c.jsx("h2",{className:"text-sm font-semibold text-pri",children:a("demo.tasksTitle")}),c.jsxs("span",{className:"text-xs text-ter",children:[Math.min(l.doneTasks,rf.length),"/",rf.length]})]}),c.jsx("ul",{className:"space-y-2",children:rf.map((f,p)=>{const g=p<l.doneTasks;return c.jsxs("li",{className:"flex items-start gap-2 text-sm","data-testid":`demo-task-${p}`,"data-done":g||void 0,children:[g?c.jsx(Xb,{size:16,className:"mt-0.5 shrink-0 text-status-green"}):c.jsx(WS,{size:16,className:"mt-0.5 shrink-0 text-ter"}),c.jsx("span",{className:g?"text-pri":"text-sec",children:f})]},f)})})]}),c.jsxs("div",{className:"rounded-md border bg-0 p-3","data-testid":"demo-team",children:[c.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[c.jsx(wc,{size:15,className:"text-accent"}),c.jsx("h2",{className:"text-sm font-semibold text-pri",children:a("demo.teamTitle")})]}),c.jsx("div",{className:"grid gap-2",children:oC.map((f,p)=>{const g=l.workerStates[p]??"idle";return c.jsxs("div",{className:"rounded border px-3 py-2","data-testid":`demo-worker-${f.name}`,style:{borderColor:"var(--border)"},children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"text-sm font-medium text-pri",children:f.name}),c.jsx("span",{className:"rounded px-1.5 py-0.5 text-[11px] text-sec bg-2",children:g})]}),c.jsx("p",{className:"mt-1 text-xs text-ter",children:f.role})]},f.name)})})]})]})]})})]})};function Bt(t,a,{checkForDefaultPrevented:o=!0}={}){return function(l){if(t?.(l),o===!1||!l.defaultPrevented)return a?.(l)}}function my(t,a){if(typeof t=="function")return t(a);t!=null&&(t.current=a)}function d0(...t){return a=>{let o=!1;const i=t.map(l=>{const u=my(l,a);return!o&&typeof u=="function"&&(o=!0),u});if(o)return()=>{for(let l=0;l<i.length;l++){const u=i[l];typeof u=="function"?u():my(t[l],null)}}}}function Tn(...t){return y.useCallback(d0(...t),t)}function iC(t,a){const o=y.createContext(a),i=u=>{const{children:f,...p}=u,g=y.useMemo(()=>p,Object.values(p));return c.jsx(o.Provider,{value:g,children:f})};i.displayName=t+"Provider";function l(u){const f=y.useContext(o);if(f)return f;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${t}\``)}return[i,l]}function Nm(t,a=[]){let o=[];function i(u,f){const p=y.createContext(f),g=o.length;o=[...o,f];const m=v=>{const{scope:k,children:S,...E}=v,w=k?.[t]?.[g]||p,C=y.useMemo(()=>E,Object.values(E));return c.jsx(w.Provider,{value:C,children:S})};m.displayName=u+"Provider";function b(v,k){const S=k?.[t]?.[g]||p,E=y.useContext(S);if(E)return E;if(f!==void 0)return f;throw new Error(`\`${v}\` must be used within \`${u}\``)}return[m,b]}const l=()=>{const u=o.map(f=>y.createContext(f));return function(p){const g=p?.[t]||u;return y.useMemo(()=>({[`__scope${t}`]:{...p,[t]:g}}),[p,g])}};return l.scopeName=t,[i,lC(l,...a)]}function lC(...t){const a=t[0];if(t.length===1)return a;const o=()=>{const i=t.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(u){const f=i.reduce((p,{useScope:g,scopeName:m})=>{const v=g(u)[`__scope${m}`];return{...p,...v}},{});return y.useMemo(()=>({[`__scope${a.scopeName}`]:f}),[f])}};return o.scopeName=a.scopeName,o}var Xa=globalThis?.document?y.useLayoutEffect:()=>{},cC=$b[" useId ".trim().toString()]||(()=>{}),uC=0;function Wl(t){const[a,o]=y.useState(cC());return Xa(()=>{o(i=>i??String(uC++))},[t]),t||(a?`radix-${a}`:"")}var dC=$b[" useInsertionEffect ".trim().toString()]||Xa;function f0({prop:t,defaultProp:a,onChange:o=()=>{},caller:i}){const[l,u,f]=fC({defaultProp:a,onChange:o}),p=t!==void 0,g=p?t:l;{const b=y.useRef(t!==void 0);y.useEffect(()=>{const v=b.current;v!==p&&console.warn(`${i} is changing from ${v?"controlled":"uncontrolled"} to ${p?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),b.current=p},[p,i])}const m=y.useCallback(b=>{if(p){const v=mC(b)?b(t):b;v!==t&&f.current?.(v)}else u(b)},[p,t,u,f]);return[g,m]}function fC({defaultProp:t,onChange:a}){const[o,i]=y.useState(t),l=y.useRef(o),u=y.useRef(a);return dC(()=>{u.current=a},[a]),y.useEffect(()=>{l.current!==o&&(u.current?.(o),l.current=o)},[o,l]),[o,i,u]}function mC(t){return typeof t=="function"}var xc=Vb();const pC=Yb(xc);function m0(t){const a=hC(t),o=y.forwardRef((i,l)=>{const{children:u,...f}=i,p=y.Children.toArray(u),g=p.find(vC);if(g){const m=g.props.children,b=p.map(v=>v===g?y.Children.count(m)>1?y.Children.only(null):y.isValidElement(m)?m.props.children:null:v);return c.jsx(a,{...f,ref:l,children:y.isValidElement(m)?y.cloneElement(m,void 0,b):null})}return c.jsx(a,{...f,ref:l,children:u})});return o.displayName=`${t}.Slot`,o}function hC(t){const a=y.forwardRef((o,i)=>{const{children:l,...u}=o;if(y.isValidElement(l)){const f=bC(l),p=yC(u,l.props);return l.type!==y.Fragment&&(p.ref=i?d0(i,f):f),y.cloneElement(l,p)}return y.Children.count(l)>1?y.Children.only(null):null});return a.displayName=`${t}.SlotClone`,a}var p0=Symbol("radix.slottable");function gC(t){const a=({children:o})=>c.jsx(c.Fragment,{children:o});return a.displayName=`${t}.Slottable`,a.__radixId=p0,a}function vC(t){return y.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===p0}function yC(t,a){const o={...a};for(const i in a){const l=t[i],u=a[i];/^on[A-Z]/.test(i)?l&&u?o[i]=(...p)=>{const g=u(...p);return l(...p),g}:l&&(o[i]=l):i==="style"?o[i]={...l,...u}:i==="className"&&(o[i]=[l,u].filter(Boolean).join(" "))}return{...t,...o}}function bC(t){let a=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,o=a&&"isReactWarning"in a&&a.isReactWarning;return o?t.ref:(a=Object.getOwnPropertyDescriptor(t,"ref")?.get,o=a&&"isReactWarning"in a&&a.isReactWarning,o?t.props.ref:t.props.ref||t.ref)}var wC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],It=wC.reduce((t,a)=>{const o=m0(`Primitive.${a}`),i=y.forwardRef((l,u)=>{const{asChild:f,...p}=l,g=f?o:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(g,{...p,ref:u})});return i.displayName=`Primitive.${a}`,{...t,[a]:i}},{});function xC(t,a){t&&xc.flushSync(()=>t.dispatchEvent(a))}function So(t){const a=y.useRef(t);return y.useEffect(()=>{a.current=t}),y.useMemo(()=>(...o)=>a.current?.(...o),[])}function kC(t,a=globalThis?.document){const o=So(t);y.useEffect(()=>{const i=l=>{l.key==="Escape"&&o(l)};return a.addEventListener("keydown",i,{capture:!0}),()=>a.removeEventListener("keydown",i,{capture:!0})},[o,a])}var SC="DismissableLayer",Kf="dismissableLayer.update",EC="dismissableLayer.pointerDownOutside",CC="dismissableLayer.focusOutside",py,h0=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jm=y.forwardRef((t,a)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:f,onDismiss:p,...g}=t,m=y.useContext(h0),[b,v]=y.useState(null),k=b?.ownerDocument??globalThis?.document,[,S]=y.useState({}),E=Tn(a,L=>v(L)),w=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),T=w.indexOf(C),N=b?w.indexOf(b):-1,A=m.layersWithOutsidePointerEventsDisabled.size>0,j=N>=T,O=jC(L=>{const q=L.target,$=[...m.branches].some(ae=>ae.contains(q));!j||$||(l?.(L),f?.(L),L.defaultPrevented||p?.())},k),D=_C(L=>{const q=L.target;[...m.branches].some(ae=>ae.contains(q))||(u?.(L),f?.(L),L.defaultPrevented||p?.())},k);return kC(L=>{N===m.layers.size-1&&(i?.(L),!L.defaultPrevented&&p&&(L.preventDefault(),p()))},k),y.useEffect(()=>{if(b)return o&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(py=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(b)),m.layers.add(b),hy(),()=>{o&&m.layersWithOutsidePointerEventsDisabled.size===1&&(k.body.style.pointerEvents=py)}},[b,k,o,m]),y.useEffect(()=>()=>{b&&(m.layers.delete(b),m.layersWithOutsidePointerEventsDisabled.delete(b),hy())},[b,m]),y.useEffect(()=>{const L=()=>S({});return document.addEventListener(Kf,L),()=>document.removeEventListener(Kf,L)},[]),c.jsx(It.div,{...g,ref:E,style:{pointerEvents:A?j?"auto":"none":void 0,...t.style},onFocusCapture:Bt(t.onFocusCapture,D.onFocusCapture),onBlurCapture:Bt(t.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Bt(t.onPointerDownCapture,O.onPointerDownCapture)})});jm.displayName=SC;var TC="DismissableLayerBranch",NC=y.forwardRef((t,a)=>{const o=y.useContext(h0),i=y.useRef(null),l=Tn(a,i);return y.useEffect(()=>{const u=i.current;if(u)return o.branches.add(u),()=>{o.branches.delete(u)}},[o.branches]),c.jsx(It.div,{...t,ref:l})});NC.displayName=TC;function jC(t,a=globalThis?.document){const o=So(t),i=y.useRef(!1),l=y.useRef(()=>{});return y.useEffect(()=>{const u=p=>{if(p.target&&!i.current){let g=function(){g0(EC,o,m,{discrete:!0})};const m={originalEvent:p};p.pointerType==="touch"?(a.removeEventListener("click",l.current),l.current=g,a.addEventListener("click",l.current,{once:!0})):g()}else a.removeEventListener("click",l.current);i.current=!1},f=window.setTimeout(()=>{a.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(f),a.removeEventListener("pointerdown",u),a.removeEventListener("click",l.current)}},[a,o]),{onPointerDownCapture:()=>i.current=!0}}function _C(t,a=globalThis?.document){const o=So(t),i=y.useRef(!1);return y.useEffect(()=>{const l=u=>{u.target&&!i.current&&g0(CC,o,{originalEvent:u},{discrete:!1})};return a.addEventListener("focusin",l),()=>a.removeEventListener("focusin",l)},[a,o]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function hy(){const t=new CustomEvent(Kf);document.dispatchEvent(t)}function g0(t,a,o,{discrete:i}){const l=o.originalEvent.target,u=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:o});a&&l.addEventListener(t,a,{once:!0}),i?xC(l,u):l.dispatchEvent(u)}var of="focusScope.autoFocusOnMount",sf="focusScope.autoFocusOnUnmount",gy={bubbles:!1,cancelable:!0},AC="FocusScope",v0=y.forwardRef((t,a)=>{const{loop:o=!1,trapped:i=!1,onMountAutoFocus:l,onUnmountAutoFocus:u,...f}=t,[p,g]=y.useState(null),m=So(l),b=So(u),v=y.useRef(null),k=Tn(a,w=>g(w)),S=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(i){let w=function(A){if(S.paused||!p)return;const j=A.target;p.contains(j)?v.current=j:qa(v.current,{select:!0})},C=function(A){if(S.paused||!p)return;const j=A.relatedTarget;j!==null&&(p.contains(j)||qa(v.current,{select:!0}))},T=function(A){if(document.activeElement===document.body)for(const O of A)O.removedNodes.length>0&&qa(p)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const N=new MutationObserver(T);return p&&N.observe(p,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),N.disconnect()}}},[i,p,S.paused]),y.useEffect(()=>{if(p){yy.add(S);const w=document.activeElement;if(!p.contains(w)){const T=new CustomEvent(of,gy);p.addEventListener(of,m),p.dispatchEvent(T),T.defaultPrevented||(RC(zC(y0(p)),{select:!0}),document.activeElement===w&&qa(p))}return()=>{p.removeEventListener(of,m),setTimeout(()=>{const T=new CustomEvent(sf,gy);p.addEventListener(sf,b),p.dispatchEvent(T),T.defaultPrevented||qa(w??document.body,{select:!0}),p.removeEventListener(sf,b),yy.remove(S)},0)}}},[p,m,b,S]);const E=y.useCallback(w=>{if(!o&&!i||S.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,T=document.activeElement;if(C&&T){const N=w.currentTarget,[A,j]=OC(N);A&&j?!w.shiftKey&&T===j?(w.preventDefault(),o&&qa(A,{select:!0})):w.shiftKey&&T===A&&(w.preventDefault(),o&&qa(j,{select:!0})):T===N&&w.preventDefault()}},[o,i,S.paused]);return c.jsx(It.div,{tabIndex:-1,...f,ref:k,onKeyDown:E})});v0.displayName=AC;function RC(t,{select:a=!1}={}){const o=document.activeElement;for(const i of t)if(qa(i,{select:a}),document.activeElement!==o)return}function OC(t){const a=y0(t),o=vy(a,t),i=vy(a.reverse(),t);return[o,i]}function y0(t){const a=[],o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const l=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||l?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;o.nextNode();)a.push(o.currentNode);return a}function vy(t,a){for(const o of t)if(!DC(o,{upTo:a}))return o}function DC(t,{upTo:a}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(a!==void 0&&t===a)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function MC(t){return t instanceof HTMLInputElement&&"select"in t}function qa(t,{select:a=!1}={}){if(t&&t.focus){const o=document.activeElement;t.focus({preventScroll:!0}),t!==o&&MC(t)&&a&&t.select()}}var yy=LC();function LC(){let t=[];return{add(a){const o=t[0];a!==o&&o?.pause(),t=by(t,a),t.unshift(a)},remove(a){t=by(t,a),t[0]?.resume()}}}function by(t,a){const o=[...t],i=o.indexOf(a);return i!==-1&&o.splice(i,1),o}function zC(t){return t.filter(a=>a.tagName!=="A")}var HC="Portal",_m=y.forwardRef((t,a)=>{const{container:o,...i}=t,[l,u]=y.useState(!1);Xa(()=>u(!0),[]);const f=o||l&&globalThis?.document?.body;return f?pC.createPortal(c.jsx(It.div,{...i,ref:a}),f):null});_m.displayName=HC;function BC(t,a){return y.useReducer((o,i)=>a[o][i]??o,t)}var Ro=t=>{const{present:a,children:o}=t,i=UC(a),l=typeof o=="function"?o({present:i.isPresent}):y.Children.only(o),u=Tn(i.ref,WC(l));return typeof o=="function"||i.isPresent?y.cloneElement(l,{ref:u}):null};Ro.displayName="Presence";function UC(t){const[a,o]=y.useState(),i=y.useRef(null),l=y.useRef(t),u=y.useRef("none"),f=t?"mounted":"unmounted",[p,g]=BC(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const m=jl(i.current);u.current=p==="mounted"?m:"none"},[p]),Xa(()=>{const m=i.current,b=l.current;if(b!==t){const k=u.current,S=jl(m);t?g("MOUNT"):S==="none"||m?.display==="none"?g("UNMOUNT"):g(b&&k!==S?"ANIMATION_OUT":"UNMOUNT"),l.current=t}},[t,g]),Xa(()=>{if(a){let m;const b=a.ownerDocument.defaultView??window,v=S=>{const w=jl(i.current).includes(CSS.escape(S.animationName));if(S.target===a&&w&&(g("ANIMATION_END"),!l.current)){const C=a.style.animationFillMode;a.style.animationFillMode="forwards",m=b.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=C)})}},k=S=>{S.target===a&&(u.current=jl(i.current))};return a.addEventListener("animationstart",k),a.addEventListener("animationcancel",v),a.addEventListener("animationend",v),()=>{b.clearTimeout(m),a.removeEventListener("animationstart",k),a.removeEventListener("animationcancel",v),a.removeEventListener("animationend",v)}}else g("ANIMATION_END")},[a,g]),{isPresent:["mounted","unmountSuspended"].includes(p),ref:y.useCallback(m=>{i.current=m?getComputedStyle(m):null,o(m)},[])}}function jl(t){return t?.animationName||"none"}function WC(t){let a=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,o=a&&"isReactWarning"in a&&a.isReactWarning;return o?t.ref:(a=Object.getOwnPropertyDescriptor(t,"ref")?.get,o=a&&"isReactWarning"in a&&a.isReactWarning,o?t.props.ref:t.props.ref||t.ref)}var lf=0;function IC(){y.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??wy()),document.body.insertAdjacentElement("beforeend",t[1]??wy()),lf++,()=>{lf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),lf--}},[])}function wy(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Ln=function(){return Ln=Object.assign||function(a){for(var o,i=1,l=arguments.length;i<l;i++){o=arguments[i];for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&(a[u]=o[u])}return a},Ln.apply(this,arguments)};function b0(t,a){var o={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&a.indexOf(i)<0&&(o[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,i=Object.getOwnPropertySymbols(t);l<i.length;l++)a.indexOf(i[l])<0&&Object.prototype.propertyIsEnumerable.call(t,i[l])&&(o[i[l]]=t[i[l]]);return o}function qC(t,a,o){if(o||arguments.length===2)for(var i=0,l=a.length,u;i<l;i++)(u||!(i in a))&&(u||(u=Array.prototype.slice.call(a,0,i)),u[i]=a[i]);return t.concat(u||Array.prototype.slice.call(a))}var Il="right-scroll-bar-position",ql="width-before-scroll-bar",PC="with-scroll-bars-hidden",FC="--removed-body-scroll-bar-size";function cf(t,a){return typeof t=="function"?t(a):t&&(t.current=a),t}function KC(t,a){var o=y.useState(function(){return{value:t,callback:a,facade:{get current(){return o.value},set current(i){var l=o.value;l!==i&&(o.value=i,o.callback(i,l))}}}})[0];return o.callback=a,o.facade}var YC=typeof window<"u"?y.useLayoutEffect:y.useEffect,xy=new WeakMap;function $C(t,a){var o=KC(null,function(i){return t.forEach(function(l){return cf(l,i)})});return YC(function(){var i=xy.get(o);if(i){var l=new Set(i),u=new Set(t),f=o.current;l.forEach(function(p){u.has(p)||cf(p,null)}),u.forEach(function(p){l.has(p)||cf(p,f)})}xy.set(o,t)},[t]),o}function VC(t){return t}function GC(t,a){a===void 0&&(a=VC);var o=[],i=!1,l={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return o.length?o[o.length-1]:t},useMedium:function(u){var f=a(u,i);return o.push(f),function(){o=o.filter(function(p){return p!==f})}},assignSyncMedium:function(u){for(i=!0;o.length;){var f=o;o=[],f.forEach(u)}o={push:function(p){return u(p)},filter:function(){return o}}},assignMedium:function(u){i=!0;var f=[];if(o.length){var p=o;o=[],p.forEach(u),f=o}var g=function(){var b=f;f=[],b.forEach(u)},m=function(){return Promise.resolve().then(g)};m(),o={push:function(b){f.push(b),m()},filter:function(b){return f=f.filter(b),o}}}};return l}function XC(t){t===void 0&&(t={});var a=GC(null);return a.options=Ln({async:!0,ssr:!1},t),a}var w0=function(t){var a=t.sideCar,o=b0(t,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=a.read();if(!i)throw new Error("Sidecar medium not found");return y.createElement(i,Ln({},o))};w0.isSideCarExport=!0;function ZC(t,a){return t.useMedium(a),w0}var x0=XC(),uf=function(){},kc=y.forwardRef(function(t,a){var o=y.useRef(null),i=y.useState({onScrollCapture:uf,onWheelCapture:uf,onTouchMoveCapture:uf}),l=i[0],u=i[1],f=t.forwardProps,p=t.children,g=t.className,m=t.removeScrollBar,b=t.enabled,v=t.shards,k=t.sideCar,S=t.noRelative,E=t.noIsolation,w=t.inert,C=t.allowPinchZoom,T=t.as,N=T===void 0?"div":T,A=t.gapMode,j=b0(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=k,D=$C([o,a]),L=Ln(Ln({},j),l);return y.createElement(y.Fragment,null,b&&y.createElement(O,{sideCar:x0,removeScrollBar:m,shards:v,noRelative:S,noIsolation:E,inert:w,setCallbacks:u,allowPinchZoom:!!C,lockRef:o,gapMode:A}),f?y.cloneElement(y.Children.only(p),Ln(Ln({},L),{ref:D})):y.createElement(N,Ln({},L,{className:g,ref:D}),p))});kc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};kc.classNames={fullWidth:ql,zeroRight:Il};var QC=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function JC(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var a=QC();return a&&t.setAttribute("nonce",a),t}function eT(t,a){t.styleSheet?t.styleSheet.cssText=a:t.appendChild(document.createTextNode(a))}function tT(t){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(t)}var nT=function(){var t=0,a=null;return{add:function(o){t==0&&(a=JC())&&(eT(a,o),tT(a)),t++},remove:function(){t--,!t&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},aT=function(){var t=nT();return function(a,o){y.useEffect(function(){return t.add(a),function(){t.remove()}},[a&&o])}},k0=function(){var t=aT(),a=function(o){var i=o.styles,l=o.dynamic;return t(i,l),null};return a},rT={left:0,top:0,right:0,gap:0},df=function(t){return parseInt(t||"",10)||0},oT=function(t){var a=window.getComputedStyle(document.body),o=a[t==="padding"?"paddingLeft":"marginLeft"],i=a[t==="padding"?"paddingTop":"marginTop"],l=a[t==="padding"?"paddingRight":"marginRight"];return[df(o),df(i),df(l)]},sT=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return rT;var a=oT(t),o=document.documentElement.clientWidth,i=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,i-o+a[2]-a[0])}},iT=k0(),bo="data-scroll-locked",lT=function(t,a,o,i){var l=t.left,u=t.top,f=t.right,p=t.gap;return o===void 0&&(o="margin"),`
|
|
12
|
-
.`.concat(PC,` {
|
|
13
|
-
overflow: hidden `).concat(i,`;
|
|
14
|
-
padding-right: `).concat(p,"px ").concat(i,`;
|
|
15
|
-
}
|
|
16
|
-
body[`).concat(bo,`] {
|
|
17
|
-
overflow: hidden `).concat(i,`;
|
|
18
|
-
overscroll-behavior: contain;
|
|
19
|
-
`).concat([a&&"position: relative ".concat(i,";"),o==="margin"&&`
|
|
20
|
-
padding-left: `.concat(l,`px;
|
|
21
|
-
padding-top: `).concat(u,`px;
|
|
22
|
-
padding-right: `).concat(f,`px;
|
|
23
|
-
margin-left:0;
|
|
24
|
-
margin-top:0;
|
|
25
|
-
margin-right: `).concat(p,"px ").concat(i,`;
|
|
26
|
-
`),o==="padding"&&"padding-right: ".concat(p,"px ").concat(i,";")].filter(Boolean).join(""),`
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.`).concat(Il,` {
|
|
30
|
-
right: `).concat(p,"px ").concat(i,`;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.`).concat(ql,` {
|
|
34
|
-
margin-right: `).concat(p,"px ").concat(i,`;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.`).concat(Il," .").concat(Il,` {
|
|
38
|
-
right: 0 `).concat(i,`;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.`).concat(ql," .").concat(ql,` {
|
|
42
|
-
margin-right: 0 `).concat(i,`;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
body[`).concat(bo,`] {
|
|
46
|
-
`).concat(FC,": ").concat(p,`px;
|
|
47
|
-
}
|
|
48
|
-
`)},ky=function(){var t=parseInt(document.body.getAttribute(bo)||"0",10);return isFinite(t)?t:0},cT=function(){y.useEffect(function(){return document.body.setAttribute(bo,(ky()+1).toString()),function(){var t=ky()-1;t<=0?document.body.removeAttribute(bo):document.body.setAttribute(bo,t.toString())}},[])},uT=function(t){var a=t.noRelative,o=t.noImportant,i=t.gapMode,l=i===void 0?"margin":i;cT();var u=y.useMemo(function(){return sT(l)},[l]);return y.createElement(iT,{styles:lT(u,!a,l,o?"":"!important")})},Yf=!1;if(typeof window<"u")try{var _l=Object.defineProperty({},"passive",{get:function(){return Yf=!0,!0}});window.addEventListener("test",_l,_l),window.removeEventListener("test",_l,_l)}catch{Yf=!1}var mo=Yf?{passive:!1}:!1,dT=function(t){return t.tagName==="TEXTAREA"},S0=function(t,a){if(!(t instanceof Element))return!1;var o=window.getComputedStyle(t);return o[a]!=="hidden"&&!(o.overflowY===o.overflowX&&!dT(t)&&o[a]==="visible")},fT=function(t){return S0(t,"overflowY")},mT=function(t){return S0(t,"overflowX")},Sy=function(t,a){var o=a.ownerDocument,i=a;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var l=E0(t,i);if(l){var u=C0(t,i),f=u[1],p=u[2];if(f>p)return!0}i=i.parentNode}while(i&&i!==o.body);return!1},pT=function(t){var a=t.scrollTop,o=t.scrollHeight,i=t.clientHeight;return[a,o,i]},hT=function(t){var a=t.scrollLeft,o=t.scrollWidth,i=t.clientWidth;return[a,o,i]},E0=function(t,a){return t==="v"?fT(a):mT(a)},C0=function(t,a){return t==="v"?pT(a):hT(a)},gT=function(t,a){return t==="h"&&a==="rtl"?-1:1},vT=function(t,a,o,i,l){var u=gT(t,window.getComputedStyle(a).direction),f=u*i,p=o.target,g=a.contains(p),m=!1,b=f>0,v=0,k=0;do{if(!p)break;var S=C0(t,p),E=S[0],w=S[1],C=S[2],T=w-C-u*E;(E||T)&&E0(t,p)&&(v+=T,k+=E);var N=p.parentNode;p=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!g&&p!==document.body||g&&(a.contains(p)||a===p));return(b&&Math.abs(v)<1||!b&&Math.abs(k)<1)&&(m=!0),m},Al=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Ey=function(t){return[t.deltaX,t.deltaY]},Cy=function(t){return t&&"current"in t?t.current:t},yT=function(t,a){return t[0]===a[0]&&t[1]===a[1]},bT=function(t){return`
|
|
49
|
-
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
50
|
-
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
51
|
-
`)},wT=0,po=[];function xT(t){var a=y.useRef([]),o=y.useRef([0,0]),i=y.useRef(),l=y.useState(wT++)[0],u=y.useState(k0)[0],f=y.useRef(t);y.useEffect(function(){f.current=t},[t]),y.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(l));var w=qC([t.lockRef.current],(t.shards||[]).map(Cy),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(l))})}}},[t.inert,t.lockRef.current,t.shards]);var p=y.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!f.current.allowPinchZoom;var T=Al(w),N=o.current,A="deltaX"in w?w.deltaX:N[0]-T[0],j="deltaY"in w?w.deltaY:N[1]-T[1],O,D=w.target,L=Math.abs(A)>Math.abs(j)?"h":"v";if("touches"in w&&L==="h"&&D.type==="range")return!1;var q=window.getSelection(),$=q&&q.anchorNode,ae=$?$===D||$.contains(D):!1;if(ae)return!1;var G=Sy(L,D);if(!G)return!0;if(G?O=L:(O=L==="v"?"h":"v",G=Sy(L,D)),!G)return!1;if(!i.current&&"changedTouches"in w&&(A||j)&&(i.current=O),!O)return!0;var W=i.current||O;return vT(W,C,w,W==="h"?A:j)},[]),g=y.useCallback(function(w){var C=w;if(!(!po.length||po[po.length-1]!==u)){var T="deltaY"in C?Ey(C):Al(C),N=a.current.filter(function(O){return O.name===C.type&&(O.target===C.target||C.target===O.shadowParent)&&yT(O.delta,T)})[0];if(N&&N.should){C.cancelable&&C.preventDefault();return}if(!N){var A=(f.current.shards||[]).map(Cy).filter(Boolean).filter(function(O){return O.contains(C.target)}),j=A.length>0?p(C,A[0]):!f.current.noIsolation;j&&C.cancelable&&C.preventDefault()}}},[]),m=y.useCallback(function(w,C,T,N){var A={name:w,delta:C,target:T,should:N,shadowParent:kT(T)};a.current.push(A),setTimeout(function(){a.current=a.current.filter(function(j){return j!==A})},1)},[]),b=y.useCallback(function(w){o.current=Al(w),i.current=void 0},[]),v=y.useCallback(function(w){m(w.type,Ey(w),w.target,p(w,t.lockRef.current))},[]),k=y.useCallback(function(w){m(w.type,Al(w),w.target,p(w,t.lockRef.current))},[]);y.useEffect(function(){return po.push(u),t.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:k}),document.addEventListener("wheel",g,mo),document.addEventListener("touchmove",g,mo),document.addEventListener("touchstart",b,mo),function(){po=po.filter(function(w){return w!==u}),document.removeEventListener("wheel",g,mo),document.removeEventListener("touchmove",g,mo),document.removeEventListener("touchstart",b,mo)}},[]);var S=t.removeScrollBar,E=t.inert;return y.createElement(y.Fragment,null,E?y.createElement(u,{styles:bT(l)}):null,S?y.createElement(uT,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function kT(t){for(var a=null;t!==null;)t instanceof ShadowRoot&&(a=t.host,t=t.host),t=t.parentNode;return a}const ST=ZC(x0,xT);var T0=y.forwardRef(function(t,a){return y.createElement(kc,Ln({},t,{ref:a,sideCar:ST}))});T0.classNames=kc.classNames;var ET=function(t){if(typeof document>"u")return null;var a=Array.isArray(t)?t[0]:t;return a.ownerDocument.body},ho=new WeakMap,Rl=new WeakMap,Ol={},ff=0,N0=function(t){return t&&(t.host||N0(t.parentNode))},CT=function(t,a){return a.map(function(o){if(t.contains(o))return o;var i=N0(o);return i&&t.contains(i)?i:(console.error("aria-hidden",o,"in not contained inside",t,". Doing nothing"),null)}).filter(function(o){return!!o})},TT=function(t,a,o,i){var l=CT(a,Array.isArray(t)?t:[t]);Ol[o]||(Ol[o]=new WeakMap);var u=Ol[o],f=[],p=new Set,g=new Set(l),m=function(v){!v||p.has(v)||(p.add(v),m(v.parentNode))};l.forEach(m);var b=function(v){!v||g.has(v)||Array.prototype.forEach.call(v.children,function(k){if(p.has(k))b(k);else try{var S=k.getAttribute(i),E=S!==null&&S!=="false",w=(ho.get(k)||0)+1,C=(u.get(k)||0)+1;ho.set(k,w),u.set(k,C),f.push(k),w===1&&E&&Rl.set(k,!0),C===1&&k.setAttribute(o,"true"),E||k.setAttribute(i,"true")}catch(T){console.error("aria-hidden: cannot operate on ",k,T)}})};return b(a),p.clear(),ff++,function(){f.forEach(function(v){var k=ho.get(v)-1,S=u.get(v)-1;ho.set(v,k),u.set(v,S),k||(Rl.has(v)||v.removeAttribute(i),Rl.delete(v)),S||v.removeAttribute(o)}),ff--,ff||(ho=new WeakMap,ho=new WeakMap,Rl=new WeakMap,Ol={})}},NT=function(t,a,o){o===void 0&&(o="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),l=ET(t);return l?(i.push.apply(i,Array.from(l.querySelectorAll("[aria-live], script"))),TT(i,l,o,"aria-hidden")):function(){return null}},Sc="Dialog",[j0]=Nm(Sc),[jT,Nn]=j0(Sc),_0=t=>{const{__scopeDialog:a,children:o,open:i,defaultOpen:l,onOpenChange:u,modal:f=!0}=t,p=y.useRef(null),g=y.useRef(null),[m,b]=f0({prop:i,defaultProp:l??!1,onChange:u,caller:Sc});return c.jsx(jT,{scope:a,triggerRef:p,contentRef:g,contentId:Wl(),titleId:Wl(),descriptionId:Wl(),open:m,onOpenChange:b,onOpenToggle:y.useCallback(()=>b(v=>!v),[b]),modal:f,children:o})};_0.displayName=Sc;var A0="DialogTrigger",R0=y.forwardRef((t,a)=>{const{__scopeDialog:o,...i}=t,l=Nn(A0,o),u=Tn(a,l.triggerRef);return c.jsx(It.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Om(l.open),...i,ref:u,onClick:Bt(t.onClick,l.onOpenToggle)})});R0.displayName=A0;var Am="DialogPortal",[_T,O0]=j0(Am,{forceMount:void 0}),D0=t=>{const{__scopeDialog:a,forceMount:o,children:i,container:l}=t,u=Nn(Am,a);return c.jsx(_T,{scope:a,forceMount:o,children:y.Children.map(i,f=>c.jsx(Ro,{present:o||u.open,children:c.jsx(_m,{asChild:!0,container:l,children:f})}))})};D0.displayName=Am;var Ql="DialogOverlay",M0=y.forwardRef((t,a)=>{const o=O0(Ql,t.__scopeDialog),{forceMount:i=o.forceMount,...l}=t,u=Nn(Ql,t.__scopeDialog);return u.modal?c.jsx(Ro,{present:i||u.open,children:c.jsx(RT,{...l,ref:a})}):null});M0.displayName=Ql;var AT=m0("DialogOverlay.RemoveScroll"),RT=y.forwardRef((t,a)=>{const{__scopeDialog:o,...i}=t,l=Nn(Ql,o);return c.jsx(T0,{as:AT,allowPinchZoom:!0,shards:[l.contentRef],children:c.jsx(It.div,{"data-state":Om(l.open),...i,ref:a,style:{pointerEvents:"auto",...i.style}})})}),Cr="DialogContent",L0=y.forwardRef((t,a)=>{const o=O0(Cr,t.__scopeDialog),{forceMount:i=o.forceMount,...l}=t,u=Nn(Cr,t.__scopeDialog);return c.jsx(Ro,{present:i||u.open,children:u.modal?c.jsx(OT,{...l,ref:a}):c.jsx(DT,{...l,ref:a})})});L0.displayName=Cr;var OT=y.forwardRef((t,a)=>{const o=Nn(Cr,t.__scopeDialog),i=y.useRef(null),l=Tn(a,o.contentRef,i);return y.useEffect(()=>{const u=i.current;if(u)return NT(u)},[]),c.jsx(z0,{...t,ref:l,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Bt(t.onCloseAutoFocus,u=>{u.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:Bt(t.onPointerDownOutside,u=>{const f=u.detail.originalEvent,p=f.button===0&&f.ctrlKey===!0;(f.button===2||p)&&u.preventDefault()}),onFocusOutside:Bt(t.onFocusOutside,u=>u.preventDefault())})}),DT=y.forwardRef((t,a)=>{const o=Nn(Cr,t.__scopeDialog),i=y.useRef(!1),l=y.useRef(!1);return c.jsx(z0,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{t.onCloseAutoFocus?.(u),u.defaultPrevented||(i.current||o.triggerRef.current?.focus(),u.preventDefault()),i.current=!1,l.current=!1},onInteractOutside:u=>{t.onInteractOutside?.(u),u.defaultPrevented||(i.current=!0,u.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const f=u.target;o.triggerRef.current?.contains(f)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&l.current&&u.preventDefault()}})}),z0=y.forwardRef((t,a)=>{const{__scopeDialog:o,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:u,...f}=t,p=Nn(Cr,o),g=y.useRef(null),m=Tn(a,g);return IC(),c.jsxs(c.Fragment,{children:[c.jsx(v0,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:l,onUnmountAutoFocus:u,children:c.jsx(jm,{role:"dialog",id:p.contentId,"aria-describedby":p.descriptionId,"aria-labelledby":p.titleId,"data-state":Om(p.open),...f,ref:m,onDismiss:()=>p.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(MT,{titleId:p.titleId}),c.jsx(zT,{contentRef:g,descriptionId:p.descriptionId})]})]})}),Rm="DialogTitle",H0=y.forwardRef((t,a)=>{const{__scopeDialog:o,...i}=t,l=Nn(Rm,o);return c.jsx(It.h2,{id:l.titleId,...i,ref:a})});H0.displayName=Rm;var B0="DialogDescription",U0=y.forwardRef((t,a)=>{const{__scopeDialog:o,...i}=t,l=Nn(B0,o);return c.jsx(It.p,{id:l.descriptionId,...i,ref:a})});U0.displayName=B0;var W0="DialogClose",I0=y.forwardRef((t,a)=>{const{__scopeDialog:o,...i}=t,l=Nn(W0,o);return c.jsx(It.button,{type:"button",...i,ref:a,onClick:Bt(t.onClick,()=>l.onOpenChange(!1))})});I0.displayName=W0;function Om(t){return t?"open":"closed"}var q0="DialogTitleWarning",[mM,P0]=iC(q0,{contentName:Cr,titleName:Rm,docsSlug:"dialog"}),MT=({titleId:t})=>{const a=P0(q0),o=`\`${a.contentName}\` requires a \`${a.titleName}\` for the component to be accessible for screen reader users.
|
|
52
|
-
|
|
53
|
-
If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
54
|
-
|
|
55
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return y.useEffect(()=>{t&&(document.getElementById(t)||console.error(o))},[o,t]),null},LT="DialogDescriptionWarning",zT=({contentRef:t,descriptionId:a})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${P0(LT).contentName}}.`;return y.useEffect(()=>{const l=t.current?.getAttribute("aria-describedby");a&&l&&(document.getElementById(a)||console.warn(i))},[i,t,a]),null},Oo=_0,HT=R0,Do=D0,Mo=M0,Lo=L0,zo=H0,oi=U0,pM=I0;const BT=(t,a={})=>{const o=new URL(t,window.location.href);o.protocol=o.protocol==="https:"?"wss:":"ws:";for(const[i,l]of Object.entries(a))l!==void 0&&o.searchParams.set(i,String(l));return o.toString()},UT={requiresUiSession:!0,fetch(t,a){return fetch(t,a)},openWebSocket(t,a){return new WebSocket(BT(t,a))}};let Eo=UT;const WT=t=>{Eo=t},F0=()=>Eo,K0=()=>Eo.requiresUiSession!==!1,Y0=t=>({id:t.id,name:t.name,role:t.role,status:t.status,pendingTaskCount:t.pending_task_count,...t.last_pty_line?{lastPtyLine:t.last_pty_line}:{},...t.command_preset_id?{commandPresetId:t.command_preset_id}:{},...t.ephemeral===!0?{ephemeral:!0}:{},...t.spawned_by?{spawnedBy:t.spawned_by}:{}}),je=async(t,a)=>{try{const o=await t.json();if(typeof o.error=="string"&&o.error.trim())return o.error}catch{}return a},IT=async t=>{if(t.status!==403)return!1;try{return(await t.clone().json()).error==="UI endpoint requires valid UI token"}catch{return!1}},$0=async()=>{if(!K0())return;const t=await Eo.fetch("/api/ui/session",{mode:"same-origin"});if(!t.ok)throw new Error("Failed to initialize UI session");await t.json()};let mf=null;const qT=()=>(mf??=$0().finally(()=>{mf=null}),mf),pe=async(t,a)=>{const o=await Eo.fetch(t,a);return!K0()||!await IT(o)?o:(await qT(),Eo.fetch(t,a))},PT=async()=>{const t=await pe("/api/workspaces");if(!t.ok)throw new Error("Failed to load workspaces");return await t.json()},FT=async()=>{const t=await pe("/api/version");if(!t.ok)throw new Error("Failed to load version info");const a=await t.json();return{canRunHiveUpdate:a.can_run_hive_update??a.install_hint==="hive update",currentVersion:a.current_version,installHint:a.install_hint,installSource:a.install_source??"unknown",latestVersion:a.latest_version,packageName:a.package_name,releaseUrl:a.release_url,updateNote:a.update_note??"",updateAvailable:a.update_available}},V0=t=>({description:t.description,id:t.id,isBuiltin:t.is_builtin,name:t.name,roleType:t.role_type}),KT=t=>({name:t.name,role_type:t.roleType,description:t.description,default_command:"",default_args:[],default_env:{}}),YT=async t=>{const a=await pe("/api/workspaces",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(!a.ok)throw new Error(await je(a,"Failed to create workspace"));return await a.json()},$T=async t=>{const a=await pe(`/api/workspaces/${t}`,{method:"DELETE"});if(!a.ok)throw new Error(await je(a,"Failed to delete workspace"))},Vs=async(t,a)=>{const o=await pe(`/api/workspaces/${t}/agents/${a}/start`,{method:"POST"});if(!o.ok)throw new Error(await je(o,"Failed to start agent run"));return{runId:(await o.json()).run_id}},Jl=async t=>{if(!(await pe(`/api/runtime/runs/${t}/stop`,{method:"POST"})).ok)throw new Error("Failed to stop agent run")};class G0 extends Error{constructor(a,o){super(o),this.status=a,this.name="RuntimeRunProbeError"}status}const VT=async t=>{const a=await pe(`/api/runtime/runs/${encodeURIComponent(t)}`,{mode:"same-origin"});if(a.status===404)return!1;if(!a.ok)throw new G0(a.status,await je(a,"Failed to load agent run"));const o=await a.json();return o.status==="starting"||o.status==="running"},GT=async(t,a,o)=>(await Jl(o).catch(i=>{console.error("[hive] swallowed:restartAgentRun.stop",i)}),Vs(t,a)),XT=async()=>{const t=await pe("/api/settings/app-state/active_workspace_id");if(!t.ok)throw new Error("Failed to load active workspace");return(await t.json()).value},X0=async t=>{if(!(await pe("/api/settings/app-state/active_workspace_id",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({value:t})})).ok)throw new Error("Failed to save active workspace")},Z0="notifications.webhook-url",ZT=async()=>{const t=await pe(`/api/settings/app-state/${Z0}`);if(!t.ok)throw new Error("Failed to load webhook URL");return(await t.json()).value??""},QT=async t=>{if(!(await pe(`/api/settings/app-state/${Z0}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({value:t.trim()})})).ok)throw new Error("Failed to save webhook URL")},hM=async()=>{const t=await pe("/api/settings/workflow-cli-policy");if(!t.ok)throw new Error("Failed to load workflow CLI policy");return await t.json()},gM=async t=>{const a=await pe("/api/settings/workflow-cli-policy",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(!a.ok)throw new Error("Failed to save workflow CLI policy");return await a.json()},JT=async()=>{const t=await pe("/api/settings/workflow-feature");if(!t.ok)throw new Error("Failed to load workflow feature flag");return await t.json()},eN=async t=>{const a=await pe("/api/settings/workflow-feature",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:t})});if(!a.ok)throw new Error("Failed to save workflow feature flag");return await a.json()},tN=async()=>{const t=await pe("/api/settings/team-autostaff");if(!t.ok)throw new Error("Failed to load auto-staff feature flag");return await t.json()},nN=async t=>{const a=await pe("/api/settings/team-autostaff",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:t})});if(!a.ok)throw new Error("Failed to save auto-staff feature flag");return await a.json()},aN=async t=>{const a=await pe(`/api/ui/workspaces/${t}/team`,{mode:"same-origin"});if(!a.ok)throw new Error("Failed to load workers");return(await a.json()).map(Y0)},rN=async()=>{const t=await pe("/api/settings/command-presets");if(!t.ok)throw new Error("Failed to load command presets");return(await t.json()).map(a=>({args:a.args,available:a.available,command:a.command,displayName:a.display_name,id:a.id}))},oN=t=>`${t}:shell`,Gs=(t,a)=>t.agent_id===oN(a),sN=async t=>{const a=await pe(`/api/workspaces/${t}/shell/start`,{method:"POST"});if(!a.ok)throw new Error(await je(a,"Failed to start workspace terminal"));return await a.json()},iN=async(t,a)=>{const o=await pe(`/api/workspaces/${t}/shell/${a}`,{method:"DELETE"});if(!o.ok)throw new Error(await je(o,"Failed to close workspace terminal"))},lN=async()=>{const t=await pe("/api/settings/role-templates",{mode:"same-origin"});if(!t.ok)throw new Error("Failed to load role templates");return(await t.json()).map(V0)},cN=async t=>{const a=await pe("/api/settings/role-templates",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(KT(t))});if(!a.ok)throw new Error(await je(a,"Failed to create role template"));return V0(await a.json())},uN=async t=>{const a=await pe(`/api/settings/role-templates/${t}`,{method:"DELETE"});if(!a.ok)throw new Error(await je(a,"Failed to delete role template"))},vM=async t=>{const a=await pe(`/api/marketplace/manifest?lang=${t}`,{mode:"same-origin"});if(!a.ok)throw new Error(await je(a,"Failed to load marketplace manifest"));return await a.json()},yM=async(t,a)=>{const o=await pe(`/api/marketplace/agent?lang=${t}&path=${encodeURIComponent(a)}`,{mode:"same-origin"});if(!o.ok)throw new Error(await je(o,"Failed to load marketplace agent"));return await o.json()},dN=async t=>{const a=await pe(`/api/ui/workspaces/${t}/runs`,{mode:"same-origin"});if(!a.ok)throw new Error("Failed to load terminal runs");return await a.json()},fN=async(t,a)=>{const o=await pe(`/api/workspaces/${t}/workers`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(a)});if(!o.ok)throw new Error(await je(o,"Failed to create worker"));const i=await o.json();return{agentStart:{error:i.agent_start?.error??null,ok:i.agent_start?.ok??!1,runId:i.agent_start?.run_id??null},worker:Y0(i)}},mN=async(t,a,o,i)=>{const l=await pe(`/api/workspaces/${t}/scenarios/${encodeURIComponent(a)}/apply`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({goal:o,locale:i})});if(!l.ok)throw new Error(await je(l,"Failed to assemble the scenario team"));return{createdWorkers:(await l.json()).created_workers}},pN=async(t,a)=>{const o=await pe(`/api/workspaces/${t}/workers/${a}`,{method:"DELETE"});if(!o.ok)throw new Error(await je(o,"Failed to delete worker"))},hN=async(t,a,o)=>{const i=await pe(`/api/workspaces/${t}/workers/${a}`,{body:JSON.stringify({name:o}),headers:{"content-type":"application/json"},method:"PATCH"});if(!i.ok)throw new Error(await je(i,"Failed to rename worker"))},gN=async t=>{const a=await pe(`/api/workspaces/${t}/tasks`);if(!a.ok)throw new Error("Failed to load tasks");return await a.json()},Dl=async(t,a)=>{const o=await pe(`/api/workspaces/${t}/tasks`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(a)});if(!o.ok)throw new Error("Failed to save tasks");return await o.json()},bM=async t=>{const a=t?`?path=${encodeURIComponent(t)}`:"";return await(await pe(`/api/fs/browse${a}`,{mode:"same-origin"})).json()},wM=async t=>await(await pe(`/api/fs/probe?path=${encodeURIComponent(t)}`,{mode:"same-origin"})).json(),xM=async()=>await(await pe("/api/fs/pick-folder",{method:"POST",mode:"same-origin"})).json(),vN=async(t,a)=>{const o=await pe(`/api/workspaces/${t}/open`,{body:JSON.stringify({target_id:a}),headers:{"content-type":"application/json"},method:"POST"});if(o.status===200)return{ok:!0,effectiveTargetId:(await o.json()).effective_target_id};if(o.status===502){const i=await o.json();return{ok:!1,effectiveTargetId:i.effective_target_id,errorCode:i.error_code}}throw new Error(await je(o,"Failed to open workspace"))},yN=t=>({actorAgentIdSnapshot:t.actor_agent_id_snapshot,actorNameSnapshot:t.actor_name_snapshot,actorRoleSnapshot:t.actor_role_snapshot,createdAt:t.created_at,excerpt:t.excerpt,id:t.id,memoryId:t.memory_id,sourceId:t.source_id,sourceSequence:t.source_sequence,sourceType:t.source_type,textHash:t.text_hash}),Ec=t=>({archivedAt:t.archived_at,body:t.body,confidence:t.confidence,createdAt:t.created_at,disabled:t.disabled,id:t.id,kind:t.kind,lastInjectedAt:t.last_injected_at,pinned:t.pinned,procedureRef:t.procedure_ref,scope:t.scope,source:t.source,sources:t.sources.map(yN),status:t.status,tags:t.tags,updatedAt:t.updated_at,workspaceId:t.workspace_id}),bN=t=>({contextType:t.context_type,dispatchId:t.dispatch_id,id:t.id,injectedAt:t.injected_at,memory:Ec(t.memory),memoryId:t.memory_id,targetAgentIdSnapshot:t.target_agent_id_snapshot,workspaceId:t.workspace_id}),kM=async(t,a={})=>{const o=new URLSearchParams;a.status&&o.set("status",a.status),a.scope&&o.set("scope",a.scope),a.query?.trim()&&o.set("query",a.query.trim()),a.limit!==void 0&&o.set("limit",String(a.limit));const i=o.size>0?`?${o}`:"",l=await pe(`/api/ui/workspaces/${t}/memory${i}`);if(!l.ok)throw new Error(await je(l,"Failed to load memory"));return(await l.json()).memories.map(Ec)},SM=async(t,a,o)=>{const i=await pe(`/api/ui/workspaces/${t}/memory/${a}`,{body:JSON.stringify(o),headers:{"content-type":"application/json"},method:"PATCH"});if(!i.ok)throw new Error(await je(i,"Failed to update memory"));const l=await i.json();return Ec(l.memory)},wN=async(t,a,o)=>{const i=await pe(`/api/ui/workspaces/${t}/memory/${a}/${o}`,{method:"POST"});if(!i.ok)throw new Error(await je(i,`Failed to ${o} memory`));const l=await i.json();return Ec(l.memory)},EM=(t,a)=>wN(t,a,"archive"),Dm=t=>({error:t.error,finishedAt:t.finished_at,id:t.id,inputSeqFrom:t.input_seq_from,inputSeqTo:t.input_seq_to,report:t.report,startedAt:t.started_at,status:t.status,trigger:t.trigger,workspaceId:t.workspace_id}),CM=async(t,a={})=>{const o=new URLSearchParams;a.limit!==void 0&&o.set("limit",String(a.limit));const i=o.size>0?`?${o}`:"",l=await pe(`/api/ui/workspaces/${t}/memory/dream-runs${i}`);if(!l.ok)throw new Error(await je(l,"Failed to load dream runs"));return(await l.json()).runs.map(Dm)},TM=async t=>{const a=await pe(`/api/ui/workspaces/${t}/memory/dream-runs`,{body:JSON.stringify({}),headers:{"content-type":"application/json"},method:"POST"});if(!a.ok)throw new Error(await je(a,"Failed to run dream"));const o=await a.json();return Dm(o.run)},NM=async(t,a)=>{const o=await pe(`/api/ui/workspaces/${t}/memory/dream-runs/${a}/revert`,{body:JSON.stringify({}),headers:{"content-type":"application/json"},method:"POST"});if(!o.ok)throw new Error(await je(o,"Failed to revert dream run"));const i=await o.json();return Dm(i.run)},jM=async t=>{const a=await pe(`/api/ui/workspaces/${t}/memory/settings`);if(!a.ok)throw new Error(await je(a,"Failed to load memory settings"));const o=await a.json();return{dreamEnabled:o.dream_enabled,enabled:o.enabled}},_M=async(t,a)=>{const o=await pe(`/api/ui/workspaces/${t}/memory/settings`,{body:JSON.stringify({...a.dreamEnabled===void 0?{}:{dream_enabled:a.dreamEnabled},...a.enabled===void 0?{}:{enabled:a.enabled}}),headers:{"content-type":"application/json"},method:"PUT"});if(!o.ok)throw new Error(await je(o,"Failed to update memory settings"));const i=await o.json();return{dreamEnabled:i.dream_enabled,enabled:i.enabled}},AM=async(t,a)=>{const o=new URLSearchParams({dispatch_id:a}),i=await pe(`/api/ui/workspaces/${t}/memory/injections?${o}`);if(!i.ok)throw new Error(await je(i,"Failed to load memory injections"));return(await i.json()).injections.map(bN)},xN=t=>({id:t.id,workspaceId:t.workspace_id,scriptPath:t.script_path,name:t.name,status:t.status,startedAt:t.started_at,finishedAt:t.finished_at,error:t.error,phase:t.phase,result:t.result??null,args:t.args??null,agentCount:typeof t.agent_count=="number"?t.agent_count:0,parentRunId:t.parent_run_id??null}),RM=async t=>{const a=await pe(`/api/workspaces/${t}/workflows/runs`);if(!a.ok)throw new Error(await je(a,"Failed to list workflow runs"));return(await a.json()).runs.map(xN)},Q0=t=>({id:t.id,workspaceId:t.workspace_id,scriptPath:t.script_path,cron:t.cron,args:t.args,enabled:t.enabled,lastRunAt:t.last_run_at,nextRunAt:t.next_run_at,createdAt:t.created_at,updatedAt:t.updated_at}),OM=async t=>{const a=await pe(`/api/workspaces/${t}/workflow-schedules`);if(!a.ok)throw new Error(await je(a,"Failed to list workflow schedules"));return(await a.json()).schedules.map(Q0)},DM=async(t,a)=>{const o=await pe(`/api/workflow-schedules/${t}`,{body:JSON.stringify(a),headers:{"content-type":"application/json"},method:"PATCH"});if(!o.ok)throw new Error(await je(o,"Failed to update workflow schedule"));const i=await o.json();return Q0(i.schedule)},kN=t=>({id:t.id,workspaceId:t.workspace_id,fromAgentId:t.from_agent_id,toAgentId:t.to_agent_id,text:t.text,status:t.status,reportText:t.report_text,reportedAt:t.reported_at,createdAt:t.created_at,workflowRunId:t.workflow_run_id,stepIndex:t.step_index,phase:t.phase,label:t.label,...t.last_pty_line?{lastPtyLine:t.last_pty_line}:{}}),MM=async t=>{const a=await pe(`/api/workflows/runs/${t}/stop`,{method:"POST"});if(!a.ok)throw new Error(await je(a,"Failed to stop workflow run"))},LM=async t=>{const a=await pe(`/api/workflows/runs/${t}/dispatches`);if(!a.ok)throw new Error(await je(a,"Failed to load workflow run dispatches"));return(await a.json()).dispatches.map(kN)},zM=async t=>{const a=await pe(`/api/workflows/runs/${t}/logs`);if(!a.ok)throw new Error(await je(a,"Failed to load workflow run logs"));return(await a.json()).logs},HM=async t=>{const a=await pe(`/api/workflow-schedules/${t}`,{method:"DELETE"});if(!a.ok)throw new Error(await je(a,"Failed to delete workflow schedule"))},SN=["disabled","loggedOut","connecting","online","reconnecting","revoked"],EN=(t,a)=>typeof t=="string"&&SN.includes(t)?t:a?"online":"disabled",Is=(t,a)=>{if(typeof t=="string"&&t.length>0)return t;throw new Error(`Remote payload missing ${a}`)},J0=(t,a)=>{if(typeof t=="number"&&Number.isFinite(t))return t;throw new Error(`Remote payload missing ${a}`)},ew=t=>({enabled:t.enabled===!0,loggedIn:t.logged_in===!0,gatewayUrl:t.gateway_url??null,connected:t.connected===!0,connection:EN(t.connection,t.connected===!0)}),CN=t=>({deviceId:t.id,name:t.name,lastActive:t.last_active,createdAt:t.created_at,revoked:t.revoked_at!==null}),TN=t=>({pairingId:Is(t.pairing_id,"pairing_id"),qr:Is(t.qr,"qr"),code:Is(t.code,"code"),expiresAt:J0(t.expires_at,"expires_at")}),NN=t=>({pairingId:Is(t.pairing_id,"pairing_id"),deviceName:t.device_name??null,sas:Is(t.sas,"sas"),expiresAt:J0(t.expires_at,"expires_at")}),jN=t=>({id:t.id,deviceId:t.device_id,ts:t.ts,workspaceId:t.workspace_id,action:t.action,endpoint:t.endpoint,result:t.result,rejectReason:t.reject_reason,byteCount:t.byte_count,preview:t.preview}),pf=async()=>{const t=await pe("/api/remote/status");if(!t.ok)throw new Error(await je(t,"Failed to load remote status"));return ew(await t.json())},_N=async t=>{const a=await pe("/api/remote/enabled",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:t})});if(!a.ok)throw new Error(await je(a,"Failed to update remote access"));return ew(await a.json())},AN=async()=>{const t=await pe("/api/remote/pairings",{method:"POST"});if(!t.ok)throw new Error(await je(t,"Failed to start pairing"));return TN(await t.json())},Ty=async()=>{const t=await pe("/api/remote/pairings/pending");if(!t.ok)throw new Error(await je(t,"Failed to load pending pairing"));const o=(await t.json())[0];return o?NN(o):null},RN=async t=>{const a=await pe(`/api/remote/pairings/${t}/confirm`,{method:"POST"});if(!a.ok)throw new Error(await je(a,"Failed to confirm pairing"))},ON=async t=>{const a=await pe(`/api/remote/pairings/${t}/reject`,{method:"POST"});if(!a.ok)throw new Error(await je(a,"Failed to reject pairing"))},tw=async()=>{const t=await pe("/api/remote/devices");if(!t.ok)throw new Error(await je(t,"Failed to load devices"));return(await t.json()).map(CN)},DN=async t=>{const a=await pe(`/api/remote/devices/${t}/revoke`,{method:"POST"});if(!a.ok)throw new Error(await je(a,"Failed to revoke device"))},MN=async(t=100)=>{const a=await pe(`/api/remote/audit?limit=${t}`);if(!a.ok)throw new Error(await je(a,"Failed to load remote activity"));return(await a.json()).map(jN)},LN=t=>t.kind==="stopped_with_queue"?{kind:t.kind,openDispatches:t.open_dispatches,pendingTaskCount:t.pending_task_count,severity:t.severity,workerId:t.worker_id,workerName:t.worker_name}:t.kind==="dispatch_waiting_report"?{dispatchId:t.dispatch_id,kind:t.kind,minutesAgo:t.minutes_ago,severity:t.severity,submittedAt:t.submitted_at,workerId:t.worker_id,workerName:t.worker_name}:t,hf=t=>({createdAt:t.created_at,id:t.id,label:t.label,phase:t.phase,reportPreview:t.report_preview??null,status:t.status,submittedAt:t.submitted_at,taskPreview:t.task_preview??null,timestamp:t.timestamp,toAgentId:t.to_agent_id,toWorkerName:t.to_worker_name,workflowRunId:t.workflow_run_id}),zN=t=>({attention:(t.attention??[]).map(LN),generatedAt:t.generated_at,recentActivity:t.recent_activity.map(a=>({...hf(a),kind:a.kind})),summary:{idleWorkers:t.summary.idle_workers,openDispatches:t.summary.open_dispatches,recentReports:t.summary.recent_reports,stoppedWithQueue:t.summary.stopped_with_queue,stoppedWorkers:t.summary.stopped_workers,totalWorkers:t.summary.total_workers,waitingReports:t.summary.waiting_reports??0,workingWorkers:t.summary.working_workers},workers:t.workers.map(a=>({currentDispatch:a.current_dispatch?hf(a.current_dispatch):null,id:a.id,latestReport:a.latest_report?hf(a.latest_report):null,name:a.name,pendingTaskCount:a.pending_task_count,role:a.role,status:a.status,terminalHint:a.terminal_hint??null})),workspaceId:t.workspace_id}),HN=async(t,a)=>{const o=await pe(`/api/ui/workspaces/${t}/action-center`,a);if(!o.ok)throw new Error(await je(o,"Failed to load action center"));return zN(await o.json())},BN=async(t,a)=>{const o=await pe(`/api/workspaces/${t}/recap`,a);if(!o.ok)throw new Error(await je(o,"Failed to load team recap"));const i=await o.json();return{generatedAt:i.generated_at,markdown:i.markdown}},UN=async()=>{const t=await pe("/api/diagnostics/support-bundle");if(!t.ok)throw new Error(await je(t,"Failed to load diagnostics"));return await t.json()},WN=async()=>{const t=await pe("/api/diagnostics/retention");if(!t.ok)throw new Error(await je(t,"Failed to load retention diagnostics"));return await t.json()},nw=async t=>{if(navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(t);return}catch{}const a=document.createElement("textarea");a.value=t,a.setAttribute("readonly",""),a.style.position="fixed",a.style.top="0",a.style.left="-9999px",a.style.opacity="0";const o=document.activeElement instanceof HTMLElement?document.activeElement:null;let i=!1;try{document.body.appendChild(a),a.focus(),a.select(),a.setSelectionRange(0,a.value.length),i=document.execCommand("copy")}finally{a.remove(),o?.focus()}if(!i)throw new Error("Clipboard copy failed")},aw=async t=>{if(navigator.clipboard?.write&&typeof ClipboardItem<"u"){const a=t.then(o=>new Blob([o],{type:"text/plain"}));a.catch(()=>{});try{await navigator.clipboard.write([new ClipboardItem({"text/plain":a})]);return}catch{}}await nw(await t)},Ny="(max-width: 767px)",rw=y.createContext({mode:"wide"}),gf={mode:"wide"},IN={mode:"mobile"},qN=(t=typeof window<"u"?window.matchMedia.bind(window):void 0)=>{const a=i=>{if(!t)return()=>{};const l=t(Ny);return l.addEventListener?.("change",i),()=>l.removeEventListener?.("change",i)},o=()=>t&&t(Ny).matches?IN:gf;return y.useSyncExternalStore(a,o,()=>gf)},PN=({children:t,value:a})=>{const o=qN();return c.jsx(rw.Provider,{value:a??o,children:t})},ow=()=>y.useContext(rw),xt=()=>ow().mode==="mobile",FN=["top","right","bottom","left"],Za=Math.min,Qt=Math.max,ec=Math.round,Ml=Math.floor,Bn=t=>({x:t,y:t}),KN={left:"right",right:"left",bottom:"top",top:"bottom"};function $f(t,a,o){return Qt(t,Za(a,o))}function la(t,a){return typeof t=="function"?t(a):t}function ca(t){return t.split("-")[0]}function Ho(t){return t.split("-")[1]}function Mm(t){return t==="x"?"y":"x"}function Lm(t){return t==="y"?"height":"width"}function Hn(t){const a=t[0];return a==="t"||a==="b"?"y":"x"}function zm(t){return Mm(Hn(t))}function YN(t,a,o){o===void 0&&(o=!1);const i=Ho(t),l=zm(t),u=Lm(l);let f=l==="x"?i===(o?"end":"start")?"right":"left":i==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(f=tc(f)),[f,tc(f)]}function $N(t){const a=tc(t);return[Vf(t),a,Vf(a)]}function Vf(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const jy=["left","right"],_y=["right","left"],VN=["top","bottom"],GN=["bottom","top"];function XN(t,a,o){switch(t){case"top":case"bottom":return o?a?_y:jy:a?jy:_y;case"left":case"right":return a?VN:GN;default:return[]}}function ZN(t,a,o,i){const l=Ho(t);let u=XN(ca(t),o==="start",i);return l&&(u=u.map(f=>f+"-"+l),a&&(u=u.concat(u.map(Vf)))),u}function tc(t){const a=ca(t);return KN[a]+t.slice(a.length)}function QN(t){return{top:0,right:0,bottom:0,left:0,...t}}function sw(t){return typeof t!="number"?QN(t):{top:t,right:t,bottom:t,left:t}}function nc(t){const{x:a,y:o,width:i,height:l}=t;return{width:i,height:l,top:o,left:a,right:a+i,bottom:o+l,x:a,y:o}}function Ay(t,a,o){let{reference:i,floating:l}=t;const u=Hn(a),f=zm(a),p=Lm(f),g=ca(a),m=u==="y",b=i.x+i.width/2-l.width/2,v=i.y+i.height/2-l.height/2,k=i[p]/2-l[p]/2;let S;switch(g){case"top":S={x:b,y:i.y-l.height};break;case"bottom":S={x:b,y:i.y+i.height};break;case"right":S={x:i.x+i.width,y:v};break;case"left":S={x:i.x-l.width,y:v};break;default:S={x:i.x,y:i.y}}switch(Ho(a)){case"start":S[f]-=k*(o&&m?-1:1);break;case"end":S[f]+=k*(o&&m?-1:1);break}return S}async function JN(t,a){var o;a===void 0&&(a={});const{x:i,y:l,platform:u,rects:f,elements:p,strategy:g}=t,{boundary:m="clippingAncestors",rootBoundary:b="viewport",elementContext:v="floating",altBoundary:k=!1,padding:S=0}=la(a,t),E=sw(S),C=p[k?v==="floating"?"reference":"floating":v],T=nc(await u.getClippingRect({element:(o=await(u.isElement==null?void 0:u.isElement(C)))==null||o?C:C.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(p.floating)),boundary:m,rootBoundary:b,strategy:g})),N=v==="floating"?{x:i,y:l,width:f.floating.width,height:f.floating.height}:f.reference,A=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p.floating)),j=await(u.isElement==null?void 0:u.isElement(A))?await(u.getScale==null?void 0:u.getScale(A))||{x:1,y:1}:{x:1,y:1},O=nc(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:N,offsetParent:A,strategy:g}):N);return{top:(T.top-O.top+E.top)/j.y,bottom:(O.bottom-T.bottom+E.bottom)/j.y,left:(T.left-O.left+E.left)/j.x,right:(O.right-T.right+E.right)/j.x}}const ej=50,tj=async(t,a,o)=>{const{placement:i="bottom",strategy:l="absolute",middleware:u=[],platform:f}=o,p=f.detectOverflow?f:{...f,detectOverflow:JN},g=await(f.isRTL==null?void 0:f.isRTL(a));let m=await f.getElementRects({reference:t,floating:a,strategy:l}),{x:b,y:v}=Ay(m,i,g),k=i,S=0;const E={};for(let w=0;w<u.length;w++){const C=u[w];if(!C)continue;const{name:T,fn:N}=C,{x:A,y:j,data:O,reset:D}=await N({x:b,y:v,initialPlacement:i,placement:k,strategy:l,middlewareData:E,rects:m,platform:p,elements:{reference:t,floating:a}});b=A??b,v=j??v,E[T]={...E[T],...O},D&&S<ej&&(S++,typeof D=="object"&&(D.placement&&(k=D.placement),D.rects&&(m=D.rects===!0?await f.getElementRects({reference:t,floating:a,strategy:l}):D.rects),{x:b,y:v}=Ay(m,k,g)),w=-1)}return{x:b,y:v,placement:k,strategy:l,middlewareData:E}},nj=t=>({name:"arrow",options:t,async fn(a){const{x:o,y:i,placement:l,rects:u,platform:f,elements:p,middlewareData:g}=a,{element:m,padding:b=0}=la(t,a)||{};if(m==null)return{};const v=sw(b),k={x:o,y:i},S=zm(l),E=Lm(S),w=await f.getDimensions(m),C=S==="y",T=C?"top":"left",N=C?"bottom":"right",A=C?"clientHeight":"clientWidth",j=u.reference[E]+u.reference[S]-k[S]-u.floating[E],O=k[S]-u.reference[S],D=await(f.getOffsetParent==null?void 0:f.getOffsetParent(m));let L=D?D[A]:0;(!L||!await(f.isElement==null?void 0:f.isElement(D)))&&(L=p.floating[A]||u.floating[E]);const q=j/2-O/2,$=L/2-w[E]/2-1,ae=Za(v[T],$),G=Za(v[N],$),W=ae,ee=L-w[E]-G,Q=L/2-w[E]/2+q,V=$f(W,Q,ee),M=!g.arrow&&Ho(l)!=null&&Q!==V&&u.reference[E]/2-(Q<W?ae:G)-w[E]/2<0,P=M?Q<W?Q-W:Q-ee:0;return{[S]:k[S]+P,data:{[S]:V,centerOffset:Q-V-P,...M&&{alignmentOffset:P}},reset:M}}}),aj=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(a){var o,i;const{placement:l,middlewareData:u,rects:f,initialPlacement:p,platform:g,elements:m}=a,{mainAxis:b=!0,crossAxis:v=!0,fallbackPlacements:k,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:w=!0,...C}=la(t,a);if((o=u.arrow)!=null&&o.alignmentOffset)return{};const T=ca(l),N=Hn(p),A=ca(p)===p,j=await(g.isRTL==null?void 0:g.isRTL(m.floating)),O=k||(A||!w?[tc(p)]:$N(p)),D=E!=="none";!k&&D&&O.push(...ZN(p,w,E,j));const L=[p,...O],q=await g.detectOverflow(a,C),$=[];let ae=((i=u.flip)==null?void 0:i.overflows)||[];if(b&&$.push(q[T]),v){const Q=YN(l,f,j);$.push(q[Q[0]],q[Q[1]])}if(ae=[...ae,{placement:l,overflows:$}],!$.every(Q=>Q<=0)){var G,W;const Q=(((G=u.flip)==null?void 0:G.index)||0)+1,V=L[Q];if(V&&(!(v==="alignment"?N!==Hn(V):!1)||ae.every(I=>Hn(I.placement)===N?I.overflows[0]>0:!0)))return{data:{index:Q,overflows:ae},reset:{placement:V}};let M=(W=ae.filter(P=>P.overflows[0]<=0).sort((P,I)=>P.overflows[1]-I.overflows[1])[0])==null?void 0:W.placement;if(!M)switch(S){case"bestFit":{var ee;const P=(ee=ae.filter(I=>{if(D){const Z=Hn(I.placement);return Z===N||Z==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(Z=>Z>0).reduce((Z,F)=>Z+F,0)]).sort((I,Z)=>I[1]-Z[1])[0])==null?void 0:ee[0];P&&(M=P);break}case"initialPlacement":M=p;break}if(l!==M)return{reset:{placement:M}}}return{}}}};function Ry(t,a){return{top:t.top-a.height,right:t.right-a.width,bottom:t.bottom-a.height,left:t.left-a.width}}function Oy(t){return FN.some(a=>t[a]>=0)}const rj=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(a){const{rects:o,platform:i}=a,{strategy:l="referenceHidden",...u}=la(t,a);switch(l){case"referenceHidden":{const f=await i.detectOverflow(a,{...u,elementContext:"reference"}),p=Ry(f,o.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:Oy(p)}}}case"escaped":{const f=await i.detectOverflow(a,{...u,altBoundary:!0}),p=Ry(f,o.floating);return{data:{escapedOffsets:p,escaped:Oy(p)}}}default:return{}}}}},iw=new Set(["left","top"]);async function oj(t,a){const{placement:o,platform:i,elements:l}=t,u=await(i.isRTL==null?void 0:i.isRTL(l.floating)),f=ca(o),p=Ho(o),g=Hn(o)==="y",m=iw.has(f)?-1:1,b=u&&g?-1:1,v=la(a,t);let{mainAxis:k,crossAxis:S,alignmentAxis:E}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return p&&typeof E=="number"&&(S=p==="end"?E*-1:E),g?{x:S*b,y:k*m}:{x:k*m,y:S*b}}const sj=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(a){var o,i;const{x:l,y:u,placement:f,middlewareData:p}=a,g=await oj(a,t);return f===((o=p.offset)==null?void 0:o.placement)&&(i=p.arrow)!=null&&i.alignmentOffset?{}:{x:l+g.x,y:u+g.y,data:{...g,placement:f}}}}},ij=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(a){const{x:o,y:i,placement:l,platform:u}=a,{mainAxis:f=!0,crossAxis:p=!1,limiter:g={fn:T=>{let{x:N,y:A}=T;return{x:N,y:A}}},...m}=la(t,a),b={x:o,y:i},v=await u.detectOverflow(a,m),k=Hn(ca(l)),S=Mm(k);let E=b[S],w=b[k];if(f){const T=S==="y"?"top":"left",N=S==="y"?"bottom":"right",A=E+v[T],j=E-v[N];E=$f(A,E,j)}if(p){const T=k==="y"?"top":"left",N=k==="y"?"bottom":"right",A=w+v[T],j=w-v[N];w=$f(A,w,j)}const C=g.fn({...a,[S]:E,[k]:w});return{...C,data:{x:C.x-o,y:C.y-i,enabled:{[S]:f,[k]:p}}}}}},lj=function(t){return t===void 0&&(t={}),{options:t,fn(a){const{x:o,y:i,placement:l,rects:u,middlewareData:f}=a,{offset:p=0,mainAxis:g=!0,crossAxis:m=!0}=la(t,a),b={x:o,y:i},v=Hn(l),k=Mm(v);let S=b[k],E=b[v];const w=la(p,a),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(g){const A=k==="y"?"height":"width",j=u.reference[k]-u.floating[A]+C.mainAxis,O=u.reference[k]+u.reference[A]-C.mainAxis;S<j?S=j:S>O&&(S=O)}if(m){var T,N;const A=k==="y"?"width":"height",j=iw.has(ca(l)),O=u.reference[v]-u.floating[A]+(j&&((T=f.offset)==null?void 0:T[v])||0)+(j?0:C.crossAxis),D=u.reference[v]+u.reference[A]+(j?0:((N=f.offset)==null?void 0:N[v])||0)-(j?C.crossAxis:0);E<O?E=O:E>D&&(E=D)}return{[k]:S,[v]:E}}}},cj=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(a){var o,i;const{placement:l,rects:u,platform:f,elements:p}=a,{apply:g=()=>{},...m}=la(t,a),b=await f.detectOverflow(a,m),v=ca(l),k=Ho(l),S=Hn(l)==="y",{width:E,height:w}=u.floating;let C,T;v==="top"||v==="bottom"?(C=v,T=k===(await(f.isRTL==null?void 0:f.isRTL(p.floating))?"start":"end")?"left":"right"):(T=v,C=k==="end"?"top":"bottom");const N=w-b.top-b.bottom,A=E-b.left-b.right,j=Za(w-b[C],N),O=Za(E-b[T],A),D=!a.middlewareData.shift;let L=j,q=O;if((o=a.middlewareData.shift)!=null&&o.enabled.x&&(q=A),(i=a.middlewareData.shift)!=null&&i.enabled.y&&(L=N),D&&!k){const ae=Qt(b.left,0),G=Qt(b.right,0),W=Qt(b.top,0),ee=Qt(b.bottom,0);S?q=E-2*(ae!==0||G!==0?ae+G:Qt(b.left,b.right)):L=w-2*(W!==0||ee!==0?W+ee:Qt(b.top,b.bottom))}await g({...a,availableWidth:q,availableHeight:L});const $=await f.getDimensions(p.floating);return E!==$.width||w!==$.height?{reset:{rects:!0}}:{}}}};function Cc(){return typeof window<"u"}function Bo(t){return lw(t)?(t.nodeName||"").toLowerCase():"#document"}function en(t){var a;return(t==null||(a=t.ownerDocument)==null?void 0:a.defaultView)||window}function Wn(t){var a;return(a=(lw(t)?t.ownerDocument:t.document)||window.document)==null?void 0:a.documentElement}function lw(t){return Cc()?t instanceof Node||t instanceof en(t).Node:!1}function En(t){return Cc()?t instanceof Element||t instanceof en(t).Element:!1}function da(t){return Cc()?t instanceof HTMLElement||t instanceof en(t).HTMLElement:!1}function Dy(t){return!Cc()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof en(t).ShadowRoot}function si(t){const{overflow:a,overflowX:o,overflowY:i,display:l}=Cn(t);return/auto|scroll|overlay|hidden|clip/.test(a+i+o)&&l!=="inline"&&l!=="contents"}function uj(t){return/^(table|td|th)$/.test(Bo(t))}function Tc(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const dj=/transform|translate|scale|rotate|perspective|filter/,fj=/paint|layout|strict|content/,yr=t=>!!t&&t!=="none";let vf;function Hm(t){const a=En(t)?Cn(t):t;return yr(a.transform)||yr(a.translate)||yr(a.scale)||yr(a.rotate)||yr(a.perspective)||!Bm()&&(yr(a.backdropFilter)||yr(a.filter))||dj.test(a.willChange||"")||fj.test(a.contain||"")}function mj(t){let a=Qa(t);for(;da(a)&&!Co(a);){if(Hm(a))return a;if(Tc(a))return null;a=Qa(a)}return null}function Bm(){return vf==null&&(vf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),vf}function Co(t){return/^(html|body|#document)$/.test(Bo(t))}function Cn(t){return en(t).getComputedStyle(t)}function Nc(t){return En(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Qa(t){if(Bo(t)==="html")return t;const a=t.assignedSlot||t.parentNode||Dy(t)&&t.host||Wn(t);return Dy(a)?a.host:a}function cw(t){const a=Qa(t);return Co(a)?t.ownerDocument?t.ownerDocument.body:t.body:da(a)&&si(a)?a:cw(a)}function Xs(t,a,o){var i;a===void 0&&(a=[]),o===void 0&&(o=!0);const l=cw(t),u=l===((i=t.ownerDocument)==null?void 0:i.body),f=en(l);if(u){const p=Gf(f);return a.concat(f,f.visualViewport||[],si(l)?l:[],p&&o?Xs(p):[])}else return a.concat(l,Xs(l,[],o))}function Gf(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function uw(t){const a=Cn(t);let o=parseFloat(a.width)||0,i=parseFloat(a.height)||0;const l=da(t),u=l?t.offsetWidth:o,f=l?t.offsetHeight:i,p=ec(o)!==u||ec(i)!==f;return p&&(o=u,i=f),{width:o,height:i,$:p}}function Um(t){return En(t)?t:t.contextElement}function wo(t){const a=Um(t);if(!da(a))return Bn(1);const o=a.getBoundingClientRect(),{width:i,height:l,$:u}=uw(a);let f=(u?ec(o.width):o.width)/i,p=(u?ec(o.height):o.height)/l;return(!f||!Number.isFinite(f))&&(f=1),(!p||!Number.isFinite(p))&&(p=1),{x:f,y:p}}const pj=Bn(0);function dw(t){const a=en(t);return!Bm()||!a.visualViewport?pj:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function hj(t,a,o){return a===void 0&&(a=!1),!o||a&&o!==en(t)?!1:a}function Tr(t,a,o,i){a===void 0&&(a=!1),o===void 0&&(o=!1);const l=t.getBoundingClientRect(),u=Um(t);let f=Bn(1);a&&(i?En(i)&&(f=wo(i)):f=wo(t));const p=hj(u,o,i)?dw(u):Bn(0);let g=(l.left+p.x)/f.x,m=(l.top+p.y)/f.y,b=l.width/f.x,v=l.height/f.y;if(u){const k=en(u),S=i&&En(i)?en(i):i;let E=k,w=Gf(E);for(;w&&i&&S!==E;){const C=wo(w),T=w.getBoundingClientRect(),N=Cn(w),A=T.left+(w.clientLeft+parseFloat(N.paddingLeft))*C.x,j=T.top+(w.clientTop+parseFloat(N.paddingTop))*C.y;g*=C.x,m*=C.y,b*=C.x,v*=C.y,g+=A,m+=j,E=en(w),w=Gf(E)}}return nc({width:b,height:v,x:g,y:m})}function jc(t,a){const o=Nc(t).scrollLeft;return a?a.left+o:Tr(Wn(t)).left+o}function fw(t,a){const o=t.getBoundingClientRect(),i=o.left+a.scrollLeft-jc(t,o),l=o.top+a.scrollTop;return{x:i,y:l}}function gj(t){let{elements:a,rect:o,offsetParent:i,strategy:l}=t;const u=l==="fixed",f=Wn(i),p=a?Tc(a.floating):!1;if(i===f||p&&u)return o;let g={scrollLeft:0,scrollTop:0},m=Bn(1);const b=Bn(0),v=da(i);if((v||!v&&!u)&&((Bo(i)!=="body"||si(f))&&(g=Nc(i)),v)){const S=Tr(i);m=wo(i),b.x=S.x+i.clientLeft,b.y=S.y+i.clientTop}const k=f&&!v&&!u?fw(f,g):Bn(0);return{width:o.width*m.x,height:o.height*m.y,x:o.x*m.x-g.scrollLeft*m.x+b.x+k.x,y:o.y*m.y-g.scrollTop*m.y+b.y+k.y}}function vj(t){return Array.from(t.getClientRects())}function yj(t){const a=Wn(t),o=Nc(t),i=t.ownerDocument.body,l=Qt(a.scrollWidth,a.clientWidth,i.scrollWidth,i.clientWidth),u=Qt(a.scrollHeight,a.clientHeight,i.scrollHeight,i.clientHeight);let f=-o.scrollLeft+jc(t);const p=-o.scrollTop;return Cn(i).direction==="rtl"&&(f+=Qt(a.clientWidth,i.clientWidth)-l),{width:l,height:u,x:f,y:p}}const My=25;function bj(t,a){const o=en(t),i=Wn(t),l=o.visualViewport;let u=i.clientWidth,f=i.clientHeight,p=0,g=0;if(l){u=l.width,f=l.height;const b=Bm();(!b||b&&a==="fixed")&&(p=l.offsetLeft,g=l.offsetTop)}const m=jc(i);if(m<=0){const b=i.ownerDocument,v=b.body,k=getComputedStyle(v),S=b.compatMode==="CSS1Compat"&&parseFloat(k.marginLeft)+parseFloat(k.marginRight)||0,E=Math.abs(i.clientWidth-v.clientWidth-S);E<=My&&(u-=E)}else m<=My&&(u+=m);return{width:u,height:f,x:p,y:g}}function wj(t,a){const o=Tr(t,!0,a==="fixed"),i=o.top+t.clientTop,l=o.left+t.clientLeft,u=da(t)?wo(t):Bn(1),f=t.clientWidth*u.x,p=t.clientHeight*u.y,g=l*u.x,m=i*u.y;return{width:f,height:p,x:g,y:m}}function Ly(t,a,o){let i;if(a==="viewport")i=bj(t,o);else if(a==="document")i=yj(Wn(t));else if(En(a))i=wj(a,o);else{const l=dw(t);i={x:a.x-l.x,y:a.y-l.y,width:a.width,height:a.height}}return nc(i)}function mw(t,a){const o=Qa(t);return o===a||!En(o)||Co(o)?!1:Cn(o).position==="fixed"||mw(o,a)}function xj(t,a){const o=a.get(t);if(o)return o;let i=Xs(t,[],!1).filter(p=>En(p)&&Bo(p)!=="body"),l=null;const u=Cn(t).position==="fixed";let f=u?Qa(t):t;for(;En(f)&&!Co(f);){const p=Cn(f),g=Hm(f);!g&&p.position==="fixed"&&(l=null),(u?!g&&!l:!g&&p.position==="static"&&!!l&&(l.position==="absolute"||l.position==="fixed")||si(f)&&!g&&mw(t,f))?i=i.filter(b=>b!==f):l=p,f=Qa(f)}return a.set(t,i),i}function kj(t){let{element:a,boundary:o,rootBoundary:i,strategy:l}=t;const f=[...o==="clippingAncestors"?Tc(a)?[]:xj(a,this._c):[].concat(o),i],p=Ly(a,f[0],l);let g=p.top,m=p.right,b=p.bottom,v=p.left;for(let k=1;k<f.length;k++){const S=Ly(a,f[k],l);g=Qt(S.top,g),m=Za(S.right,m),b=Za(S.bottom,b),v=Qt(S.left,v)}return{width:m-v,height:b-g,x:v,y:g}}function Sj(t){const{width:a,height:o}=uw(t);return{width:a,height:o}}function Ej(t,a,o){const i=da(a),l=Wn(a),u=o==="fixed",f=Tr(t,!0,u,a);let p={scrollLeft:0,scrollTop:0};const g=Bn(0);function m(){g.x=jc(l)}if(i||!i&&!u)if((Bo(a)!=="body"||si(l))&&(p=Nc(a)),i){const S=Tr(a,!0,u,a);g.x=S.x+a.clientLeft,g.y=S.y+a.clientTop}else l&&m();u&&!i&&l&&m();const b=l&&!i&&!u?fw(l,p):Bn(0),v=f.left+p.scrollLeft-g.x-b.x,k=f.top+p.scrollTop-g.y-b.y;return{x:v,y:k,width:f.width,height:f.height}}function yf(t){return Cn(t).position==="static"}function zy(t,a){if(!da(t)||Cn(t).position==="fixed")return null;if(a)return a(t);let o=t.offsetParent;return Wn(t)===o&&(o=o.ownerDocument.body),o}function pw(t,a){const o=en(t);if(Tc(t))return o;if(!da(t)){let l=Qa(t);for(;l&&!Co(l);){if(En(l)&&!yf(l))return l;l=Qa(l)}return o}let i=zy(t,a);for(;i&&uj(i)&&yf(i);)i=zy(i,a);return i&&Co(i)&&yf(i)&&!Hm(i)?o:i||mj(t)||o}const Cj=async function(t){const a=this.getOffsetParent||pw,o=this.getDimensions,i=await o(t.floating);return{reference:Ej(t.reference,await a(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Tj(t){return Cn(t).direction==="rtl"}const Nj={convertOffsetParentRelativeRectToViewportRelativeRect:gj,getDocumentElement:Wn,getClippingRect:kj,getOffsetParent:pw,getElementRects:Cj,getClientRects:vj,getDimensions:Sj,getScale:wo,isElement:En,isRTL:Tj};function hw(t,a){return t.x===a.x&&t.y===a.y&&t.width===a.width&&t.height===a.height}function jj(t,a){let o=null,i;const l=Wn(t);function u(){var p;clearTimeout(i),(p=o)==null||p.disconnect(),o=null}function f(p,g){p===void 0&&(p=!1),g===void 0&&(g=1),u();const m=t.getBoundingClientRect(),{left:b,top:v,width:k,height:S}=m;if(p||a(),!k||!S)return;const E=Ml(v),w=Ml(l.clientWidth-(b+k)),C=Ml(l.clientHeight-(v+S)),T=Ml(b),A={rootMargin:-E+"px "+-w+"px "+-C+"px "+-T+"px",threshold:Qt(0,Za(1,g))||1};let j=!0;function O(D){const L=D[0].intersectionRatio;if(L!==g){if(!j)return f();L?f(!1,L):i=setTimeout(()=>{f(!1,1e-7)},1e3)}L===1&&!hw(m,t.getBoundingClientRect())&&f(),j=!1}try{o=new IntersectionObserver(O,{...A,root:l.ownerDocument})}catch{o=new IntersectionObserver(O,A)}o.observe(t)}return f(!0),u}function _j(t,a,o,i){i===void 0&&(i={});const{ancestorScroll:l=!0,ancestorResize:u=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:g=!1}=i,m=Um(t),b=l||u?[...m?Xs(m):[],...a?Xs(a):[]]:[];b.forEach(T=>{l&&T.addEventListener("scroll",o,{passive:!0}),u&&T.addEventListener("resize",o)});const v=m&&p?jj(m,o):null;let k=-1,S=null;f&&(S=new ResizeObserver(T=>{let[N]=T;N&&N.target===m&&S&&a&&(S.unobserve(a),cancelAnimationFrame(k),k=requestAnimationFrame(()=>{var A;(A=S)==null||A.observe(a)})),o()}),m&&!g&&S.observe(m),a&&S.observe(a));let E,w=g?Tr(t):null;g&&C();function C(){const T=Tr(t);w&&!hw(w,T)&&o(),w=T,E=requestAnimationFrame(C)}return o(),()=>{var T;b.forEach(N=>{l&&N.removeEventListener("scroll",o),u&&N.removeEventListener("resize",o)}),v?.(),(T=S)==null||T.disconnect(),S=null,g&&cancelAnimationFrame(E)}}const Aj=sj,Rj=ij,Oj=aj,Dj=cj,Mj=rj,Hy=nj,Lj=lj,zj=(t,a,o)=>{const i=new Map,l={platform:Nj,...o},u={...l.platform,_c:i};return tj(t,a,{...l,platform:u})};var Hj=typeof document<"u",Bj=function(){},Pl=Hj?y.useLayoutEffect:Bj;function ac(t,a){if(t===a)return!0;if(typeof t!=typeof a)return!1;if(typeof t=="function"&&t.toString()===a.toString())return!0;let o,i,l;if(t&&a&&typeof t=="object"){if(Array.isArray(t)){if(o=t.length,o!==a.length)return!1;for(i=o;i--!==0;)if(!ac(t[i],a[i]))return!1;return!0}if(l=Object.keys(t),o=l.length,o!==Object.keys(a).length)return!1;for(i=o;i--!==0;)if(!{}.hasOwnProperty.call(a,l[i]))return!1;for(i=o;i--!==0;){const u=l[i];if(!(u==="_owner"&&t.$$typeof)&&!ac(t[u],a[u]))return!1}return!0}return t!==t&&a!==a}function gw(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function By(t,a){const o=gw(t);return Math.round(a*o)/o}function bf(t){const a=y.useRef(t);return Pl(()=>{a.current=t}),a}function Uj(t){t===void 0&&(t={});const{placement:a="bottom",strategy:o="absolute",middleware:i=[],platform:l,elements:{reference:u,floating:f}={},transform:p=!0,whileElementsMounted:g,open:m}=t,[b,v]=y.useState({x:0,y:0,strategy:o,placement:a,middlewareData:{},isPositioned:!1}),[k,S]=y.useState(i);ac(k,i)||S(i);const[E,w]=y.useState(null),[C,T]=y.useState(null),N=y.useCallback(I=>{I!==D.current&&(D.current=I,w(I))},[]),A=y.useCallback(I=>{I!==L.current&&(L.current=I,T(I))},[]),j=u||E,O=f||C,D=y.useRef(null),L=y.useRef(null),q=y.useRef(b),$=g!=null,ae=bf(g),G=bf(l),W=bf(m),ee=y.useCallback(()=>{if(!D.current||!L.current)return;const I={placement:a,strategy:o,middleware:k};G.current&&(I.platform=G.current),zj(D.current,L.current,I).then(Z=>{const F={...Z,isPositioned:W.current!==!1};Q.current&&!ac(q.current,F)&&(q.current=F,xc.flushSync(()=>{v(F)}))})},[k,a,o,G,W]);Pl(()=>{m===!1&&q.current.isPositioned&&(q.current.isPositioned=!1,v(I=>({...I,isPositioned:!1})))},[m]);const Q=y.useRef(!1);Pl(()=>(Q.current=!0,()=>{Q.current=!1}),[]),Pl(()=>{if(j&&(D.current=j),O&&(L.current=O),j&&O){if(ae.current)return ae.current(j,O,ee);ee()}},[j,O,ee,ae,$]);const V=y.useMemo(()=>({reference:D,floating:L,setReference:N,setFloating:A}),[N,A]),M=y.useMemo(()=>({reference:j,floating:O}),[j,O]),P=y.useMemo(()=>{const I={position:o,left:0,top:0};if(!M.floating)return I;const Z=By(M.floating,b.x),F=By(M.floating,b.y);return p?{...I,transform:"translate("+Z+"px, "+F+"px)",...gw(M.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:Z,top:F}},[o,p,M.floating,b.x,b.y]);return y.useMemo(()=>({...b,update:ee,refs:V,elements:M,floatingStyles:P}),[b,ee,V,M,P])}const Wj=t=>{function a(o){return{}.hasOwnProperty.call(o,"current")}return{name:"arrow",options:t,fn(o){const{element:i,padding:l}=typeof t=="function"?t(o):t;return i&&a(i)?i.current!=null?Hy({element:i.current,padding:l}).fn(o):{}:i?Hy({element:i,padding:l}).fn(o):{}}}},Ij=(t,a)=>{const o=Aj(t);return{name:o.name,fn:o.fn,options:[t,a]}},qj=(t,a)=>{const o=Rj(t);return{name:o.name,fn:o.fn,options:[t,a]}},Pj=(t,a)=>({fn:Lj(t).fn,options:[t,a]}),Fj=(t,a)=>{const o=Oj(t);return{name:o.name,fn:o.fn,options:[t,a]}},Kj=(t,a)=>{const o=Dj(t);return{name:o.name,fn:o.fn,options:[t,a]}},Yj=(t,a)=>{const o=Mj(t);return{name:o.name,fn:o.fn,options:[t,a]}},$j=(t,a)=>{const o=Wj(t);return{name:o.name,fn:o.fn,options:[t,a]}};var Vj="Arrow",vw=y.forwardRef((t,a)=>{const{children:o,width:i=10,height:l=5,...u}=t;return c.jsx(It.svg,{...u,ref:a,width:i,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?o:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});vw.displayName=Vj;var Gj=vw;function Xj(t){const[a,o]=y.useState(void 0);return Xa(()=>{if(t){o({width:t.offsetWidth,height:t.offsetHeight});const i=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const u=l[0];let f,p;if("borderBoxSize"in u){const g=u.borderBoxSize,m=Array.isArray(g)?g[0]:g;f=m.inlineSize,p=m.blockSize}else f=t.offsetWidth,p=t.offsetHeight;o({width:f,height:p})});return i.observe(t,{box:"border-box"}),()=>i.unobserve(t)}else o(void 0)},[t]),a}var Wm="Popper",[yw,bw]=Nm(Wm),[Zj,ww]=yw(Wm),xw=t=>{const{__scopePopper:a,children:o}=t,[i,l]=y.useState(null);return c.jsx(Zj,{scope:a,anchor:i,onAnchorChange:l,children:o})};xw.displayName=Wm;var kw="PopperAnchor",Sw=y.forwardRef((t,a)=>{const{__scopePopper:o,virtualRef:i,...l}=t,u=ww(kw,o),f=y.useRef(null),p=Tn(a,f),g=y.useRef(null);return y.useEffect(()=>{const m=g.current;g.current=i?.current||f.current,m!==g.current&&u.onAnchorChange(g.current)}),i?null:c.jsx(It.div,{...l,ref:p})});Sw.displayName=kw;var Im="PopperContent",[Qj,Jj]=yw(Im),Ew=y.forwardRef((t,a)=>{const{__scopePopper:o,side:i="bottom",sideOffset:l=0,align:u="center",alignOffset:f=0,arrowPadding:p=0,avoidCollisions:g=!0,collisionBoundary:m=[],collisionPadding:b=0,sticky:v="partial",hideWhenDetached:k=!1,updatePositionStrategy:S="optimized",onPlaced:E,...w}=t,C=ww(Im,o),[T,N]=y.useState(null),A=Tn(a,ue=>N(ue)),[j,O]=y.useState(null),D=Xj(j),L=D?.width??0,q=D?.height??0,$=i+(u!=="center"?"-"+u:""),ae=typeof b=="number"?b:{top:0,right:0,bottom:0,left:0,...b},G=Array.isArray(m)?m:[m],W=G.length>0,ee={padding:ae,boundary:G.filter(t_),altBoundary:W},{refs:Q,floatingStyles:V,placement:M,isPositioned:P,middlewareData:I}=Uj({strategy:"fixed",placement:$,whileElementsMounted:(...ue)=>_j(...ue,{animationFrame:S==="always"}),elements:{reference:C.anchor},middleware:[Ij({mainAxis:l+q,alignmentAxis:f}),g&&qj({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?Pj():void 0,...ee}),g&&Fj({...ee}),Kj({...ee,apply:({elements:ue,rects:ie,availableWidth:le,availableHeight:ce})=>{const{width:de,height:Te}=ie.reference,xe=ue.floating.style;xe.setProperty("--radix-popper-available-width",`${le}px`),xe.setProperty("--radix-popper-available-height",`${ce}px`),xe.setProperty("--radix-popper-anchor-width",`${de}px`),xe.setProperty("--radix-popper-anchor-height",`${Te}px`)}}),j&&$j({element:j,padding:p}),n_({arrowWidth:L,arrowHeight:q}),k&&Yj({strategy:"referenceHidden",...ee})]}),[Z,F]=Nw(M),R=So(E);Xa(()=>{P&&R?.()},[P,R]);const B=I.arrow?.x,se=I.arrow?.y,te=I.arrow?.centerOffset!==0,[fe,me]=y.useState();return Xa(()=>{T&&me(window.getComputedStyle(T).zIndex)},[T]),c.jsx("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:P?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:c.jsx(Qj,{scope:o,placedSide:Z,onArrowChange:O,arrowX:B,arrowY:se,shouldHideArrow:te,children:c.jsx(It.div,{"data-side":Z,"data-align":F,...w,ref:A,style:{...w.style,animation:P?void 0:"none"}})})})});Ew.displayName=Im;var Cw="PopperArrow",e_={top:"bottom",right:"left",bottom:"top",left:"right"},Tw=y.forwardRef(function(a,o){const{__scopePopper:i,...l}=a,u=Jj(Cw,i),f=e_[u.placedSide];return c.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:c.jsx(Gj,{...l,ref:o,style:{...l.style,display:"block"}})})});Tw.displayName=Cw;function t_(t){return t!==null}var n_=t=>({name:"transformOrigin",options:t,fn(a){const{placement:o,rects:i,middlewareData:l}=a,f=l.arrow?.centerOffset!==0,p=f?0:t.arrowWidth,g=f?0:t.arrowHeight,[m,b]=Nw(o),v={start:"0%",center:"50%",end:"100%"}[b],k=(l.arrow?.x??0)+p/2,S=(l.arrow?.y??0)+g/2;let E="",w="";return m==="bottom"?(E=f?v:`${k}px`,w=`${-g}px`):m==="top"?(E=f?v:`${k}px`,w=`${i.floating.height+g}px`):m==="right"?(E=`${-g}px`,w=f?v:`${S}px`):m==="left"&&(E=`${i.floating.width+g}px`,w=f?v:`${S}px`),{data:{x:E,y:w}}}});function Nw(t){const[a,o="center"]=t.split("-");return[a,o]}var a_=xw,r_=Sw,o_=Ew,s_=Tw,i_=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),l_="VisuallyHidden",jw=y.forwardRef((t,a)=>c.jsx(It.span,{...t,ref:a,style:{...i_,...t.style}}));jw.displayName=l_;var c_=jw,[_c]=Nm("Tooltip",[bw]),Ac=bw(),_w="TooltipProvider",u_=700,Xf="tooltip.open",[d_,qm]=_c(_w),Aw=t=>{const{__scopeTooltip:a,delayDuration:o=u_,skipDelayDuration:i=300,disableHoverableContent:l=!1,children:u}=t,f=y.useRef(!0),p=y.useRef(!1),g=y.useRef(0);return y.useEffect(()=>{const m=g.current;return()=>window.clearTimeout(m)},[]),c.jsx(d_,{scope:a,isOpenDelayedRef:f,delayDuration:o,onOpen:y.useCallback(()=>{window.clearTimeout(g.current),f.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>f.current=!0,i)},[i]),isPointerInTransitRef:p,onPointerInTransitChange:y.useCallback(m=>{p.current=m},[]),disableHoverableContent:l,children:u})};Aw.displayName=_w;var Zs="Tooltip",[f_,ii]=_c(Zs),Rw=t=>{const{__scopeTooltip:a,children:o,open:i,defaultOpen:l,onOpenChange:u,disableHoverableContent:f,delayDuration:p}=t,g=qm(Zs,t.__scopeTooltip),m=Ac(a),[b,v]=y.useState(null),k=Wl(),S=y.useRef(0),E=f??g.disableHoverableContent,w=p??g.delayDuration,C=y.useRef(!1),[T,N]=f0({prop:i,defaultProp:l??!1,onChange:L=>{L?(g.onOpen(),document.dispatchEvent(new CustomEvent(Xf))):g.onClose(),u?.(L)},caller:Zs}),A=y.useMemo(()=>T?C.current?"delayed-open":"instant-open":"closed",[T]),j=y.useCallback(()=>{window.clearTimeout(S.current),S.current=0,C.current=!1,N(!0)},[N]),O=y.useCallback(()=>{window.clearTimeout(S.current),S.current=0,N(!1)},[N]),D=y.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{C.current=!0,N(!0),S.current=0},w)},[w,N]);return y.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]),c.jsx(a_,{...m,children:c.jsx(f_,{scope:a,contentId:k,open:T,stateAttribute:A,trigger:b,onTriggerChange:v,onTriggerEnter:y.useCallback(()=>{g.isOpenDelayedRef.current?D():j()},[g.isOpenDelayedRef,D,j]),onTriggerLeave:y.useCallback(()=>{E?O():(window.clearTimeout(S.current),S.current=0)},[O,E]),onOpen:j,onClose:O,disableHoverableContent:E,children:o})})};Rw.displayName=Zs;var Zf="TooltipTrigger",Ow=y.forwardRef((t,a)=>{const{__scopeTooltip:o,...i}=t,l=ii(Zf,o),u=qm(Zf,o),f=Ac(o),p=y.useRef(null),g=Tn(a,p,l.onTriggerChange),m=y.useRef(!1),b=y.useRef(!1),v=y.useCallback(()=>m.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),c.jsx(r_,{asChild:!0,...f,children:c.jsx(It.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...i,ref:g,onPointerMove:Bt(t.onPointerMove,k=>{k.pointerType!=="touch"&&!b.current&&!u.isPointerInTransitRef.current&&(l.onTriggerEnter(),b.current=!0)}),onPointerLeave:Bt(t.onPointerLeave,()=>{l.onTriggerLeave(),b.current=!1}),onPointerDown:Bt(t.onPointerDown,()=>{l.open&&l.onClose(),m.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:Bt(t.onFocus,()=>{m.current||l.onOpen()}),onBlur:Bt(t.onBlur,l.onClose),onClick:Bt(t.onClick,l.onClose)})})});Ow.displayName=Zf;var Pm="TooltipPortal",[m_,p_]=_c(Pm,{forceMount:void 0}),Dw=t=>{const{__scopeTooltip:a,forceMount:o,children:i,container:l}=t,u=ii(Pm,a);return c.jsx(m_,{scope:a,forceMount:o,children:c.jsx(Ro,{present:o||u.open,children:c.jsx(_m,{asChild:!0,container:l,children:i})})})};Dw.displayName=Pm;var To="TooltipContent",Mw=y.forwardRef((t,a)=>{const o=p_(To,t.__scopeTooltip),{forceMount:i=o.forceMount,side:l="top",...u}=t,f=ii(To,t.__scopeTooltip);return c.jsx(Ro,{present:i||f.open,children:f.disableHoverableContent?c.jsx(Lw,{side:l,...u,ref:a}):c.jsx(h_,{side:l,...u,ref:a})})}),h_=y.forwardRef((t,a)=>{const o=ii(To,t.__scopeTooltip),i=qm(To,t.__scopeTooltip),l=y.useRef(null),u=Tn(a,l),[f,p]=y.useState(null),{trigger:g,onClose:m}=o,b=l.current,{onPointerInTransitChange:v}=i,k=y.useCallback(()=>{p(null),v(!1)},[v]),S=y.useCallback((E,w)=>{const C=E.currentTarget,T={x:E.clientX,y:E.clientY},N=w_(T,C.getBoundingClientRect()),A=x_(T,N),j=k_(w.getBoundingClientRect()),O=E_([...A,...j]);p(O),v(!0)},[v]);return y.useEffect(()=>()=>k(),[k]),y.useEffect(()=>{if(g&&b){const E=C=>S(C,b),w=C=>S(C,g);return g.addEventListener("pointerleave",E),b.addEventListener("pointerleave",w),()=>{g.removeEventListener("pointerleave",E),b.removeEventListener("pointerleave",w)}}},[g,b,S,k]),y.useEffect(()=>{if(f){const E=w=>{const C=w.target,T={x:w.clientX,y:w.clientY},N=g?.contains(C)||b?.contains(C),A=!S_(T,f);N?k():A&&(k(),m())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[g,b,f,m,k]),c.jsx(Lw,{...t,ref:u})}),[g_,v_]=_c(Zs,{isInside:!1}),y_=gC("TooltipContent"),Lw=y.forwardRef((t,a)=>{const{__scopeTooltip:o,children:i,"aria-label":l,onEscapeKeyDown:u,onPointerDownOutside:f,...p}=t,g=ii(To,o),m=Ac(o),{onClose:b}=g;return y.useEffect(()=>(document.addEventListener(Xf,b),()=>document.removeEventListener(Xf,b)),[b]),y.useEffect(()=>{if(g.trigger){const v=k=>{k.target?.contains(g.trigger)&&b()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[g.trigger,b]),c.jsx(jm,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:v=>v.preventDefault(),onDismiss:b,children:c.jsxs(o_,{"data-state":g.stateAttribute,...m,...p,ref:a,style:{...p.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(y_,{children:i}),c.jsx(g_,{scope:o,isInside:!0,children:c.jsx(c_,{id:g.contentId,role:"tooltip",children:l||i})})]})})});Mw.displayName=To;var zw="TooltipArrow",b_=y.forwardRef((t,a)=>{const{__scopeTooltip:o,...i}=t,l=Ac(o);return v_(zw,o).isInside?null:c.jsx(s_,{...l,...i,ref:a})});b_.displayName=zw;function w_(t,a){const o=Math.abs(a.top-t.y),i=Math.abs(a.bottom-t.y),l=Math.abs(a.right-t.x),u=Math.abs(a.left-t.x);switch(Math.min(o,i,l,u)){case u:return"left";case l:return"right";case o:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function x_(t,a,o=5){const i=[];switch(a){case"top":i.push({x:t.x-o,y:t.y+o},{x:t.x+o,y:t.y+o});break;case"bottom":i.push({x:t.x-o,y:t.y-o},{x:t.x+o,y:t.y-o});break;case"left":i.push({x:t.x+o,y:t.y-o},{x:t.x+o,y:t.y+o});break;case"right":i.push({x:t.x-o,y:t.y-o},{x:t.x-o,y:t.y+o});break}return i}function k_(t){const{top:a,right:o,bottom:i,left:l}=t;return[{x:l,y:a},{x:o,y:a},{x:o,y:i},{x:l,y:i}]}function S_(t,a){const{x:o,y:i}=t;let l=!1;for(let u=0,f=a.length-1;u<a.length;f=u++){const p=a[u],g=a[f],m=p.x,b=p.y,v=g.x,k=g.y;b>i!=k>i&&o<(v-m)*(i-b)/(k-b)+m&&(l=!l)}return l}function E_(t){const a=t.slice();return a.sort((o,i)=>o.x<i.x?-1:o.x>i.x?1:o.y<i.y?-1:o.y>i.y?1:0),C_(a)}function C_(t){if(t.length<=1)return t.slice();const a=[];for(let i=0;i<t.length;i++){const l=t[i];for(;a.length>=2;){const u=a[a.length-1],f=a[a.length-2];if((u.x-f.x)*(l.y-f.y)>=(u.y-f.y)*(l.x-f.x))a.pop();else break}a.push(l)}a.pop();const o=[];for(let i=t.length-1;i>=0;i--){const l=t[i];for(;o.length>=2;){const u=o[o.length-1],f=o[o.length-2];if((u.x-f.x)*(l.y-f.y)>=(u.y-f.y)*(l.x-f.x))o.pop();else break}o.push(l)}return o.pop(),a.length===1&&o.length===1&&a[0].x===o[0].x&&a[0].y===o[0].y?a:a.concat(o)}var Hw=Aw,T_=Rw,N_=Ow,j_=Dw,__=Mw;const et=({children:t,label:a,side:o="top",align:i="center"})=>a?c.jsx(Hw,{delayDuration:250,skipDelayDuration:150,children:c.jsxs(T_,{children:[c.jsx(N_,{asChild:!0,children:t}),c.jsx(j_,{children:c.jsx(__,{className:"tooltip",side:o,align:i,sideOffset:6,children:a})})]})}):c.jsx(c.Fragment,{children:t}),Bw=y.createContext(null),Uw=y.createContext([]),wf=3,A_=t=>t==="success"?3e3:t==="warning"?5e3:0;let Uy=0;const R_=()=>(Uy+=1,`t-${Uy.toString(36)}-${Date.now().toString(36)}`),O_=({children:t})=>{const[a,o]=y.useState([]),i=y.useRef(new Map),l=y.useCallback(v=>{const k=i.current.get(v);k?.timer&&clearTimeout(k.timer),i.current.delete(v)},[]),u=y.useCallback(v=>{o(k=>k.filter(S=>S.id!==v)),l(v)},[l]),f=y.useCallback(({kind:v,message:k,durationMs:S})=>{const E=R_();o(C=>{const T=[...C,{id:E,kind:v,message:k}];if(T.length<=wf)return T;const N=T.slice(0,T.length-wf);for(const A of N)l(A.id);return T.slice(T.length-wf)});const w=S??A_(v);if(w>0){const C=setTimeout(()=>u(E),w);i.current.set(E,{timer:C,dueAt:Date.now()+w,durationMs:w,remainingMs:w})}return E},[u,l]),p=y.useCallback(v=>{const k=i.current.get(v);k?.timer&&(clearTimeout(k.timer),i.current.set(v,{...k,timer:null,remainingMs:Math.max(0,k.dueAt-Date.now())}))},[]),g=y.useCallback(v=>{const k=i.current.get(v);if(!k||k.timer||k.remainingMs<=0)return;const S=setTimeout(()=>u(v),k.remainingMs);i.current.set(v,{...k,timer:S,dueAt:Date.now()+k.remainingMs})},[u]),m=y.useCallback(v=>i.current.get(v)?.durationMs??0,[]);y.useEffect(()=>{const v=i.current;return()=>{for(const k of v.values())k.timer&&clearTimeout(k.timer);v.clear()}},[]);const b=y.useMemo(()=>({show:f,dismiss:u,pauseDismiss:p,resumeDismiss:g,getDuration:m}),[f,u,p,g,m]);return c.jsx(Bw.Provider,{value:b,children:c.jsx(Uw.Provider,{value:a,children:t})})},tn=()=>{const t=y.useContext(Bw);if(!t)throw new Error("useToast must be used within ToastProvider");return t},D_=()=>y.useContext(Uw),M_=2e3,xf=()=>document.visibilityState==="hidden",Ww=(t,a)=>{const o=Math.max(0,Math.floor((Date.now()-t)/1e3));return o<60?a("common.time.sAgo",{count:o}):o<3600?a("common.time.mAgo",{count:Math.floor(o/60)}):o<86400?a("common.time.hAgo",{count:Math.floor(o/3600)}):a("common.time.dAgo",{count:Math.floor(o/86400)})},L_={cancelled:"actionCenter.activity.cancelled",queued:"actionCenter.activity.queued",reported:"actionCenter.activity.reported",submitted:"actionCenter.activity.submitted"},rc=(t,a)=>{const o=t.toWorkerName??a("actionCenter.unknownWorker");return a(L_[t.kind],{ago:Ww(t.timestamp,a),worker:o})},Fm=t=>t.reportPreview??t.taskPreview??t.label??t.phase,Iw=t=>t.currentDispatch?.taskPreview??t.latestReport?.reportPreview??t.terminalHint??null,qw=(t,a)=>t.currentDispatch?a("actionCenter.currentDispatch"):t.latestReport?a("actionCenter.latestReport"):t.terminalHint?a("actionCenter.terminalHint"):a("actionCenter.workerStatus"),Qf=(t,a)=>t.kind==="no_workers"?a("actionCenter.attention.noWorkers"):t.kind==="stopped_with_queue"?a("actionCenter.attention.stoppedWithQueue",{worker:t.workerName}):t.kind==="dispatch_waiting_report"?a("actionCenter.attention.waitingReport",{minutes:t.minutesAgo,worker:t.workerName??a("actionCenter.unknownWorker")}):a(t.kind==="remote_error"?"actionCenter.attention.remoteError":"actionCenter.attention.remoteRejected",{endpoint:t.endpoint??t.action,reason:t.reason??"unknown"}),oc=t=>t.kind==="stopped_with_queue"?`${t.kind}-${t.workerId}`:t.kind==="dispatch_waiting_report"?`${t.kind}-${t.dispatchId}`:t.kind==="remote_error"||t.kind==="remote_rejected"?`${t.kind}-${t.ts}-${t.action}-${t.endpoint??""}-${t.reason??""}`:t.kind,Pw=t=>{const[a,o]=y.useState(null),[i,l]=y.useState(!1),u=y.useCallback(async f=>HN(t,f?{signal:f}:void 0),[t]);return y.useEffect(()=>{let f=!1,p=!1,g=null,m=null;const b=async()=>{if(!(f||p||xf())){p=!0,m=new AbortController;try{const k=await u(m.signal);if(f)return;o(k),l(!1)}catch{f||l(!0)}finally{m=null,p=!1}!f&&!xf()&&(g=setTimeout(b,M_))}},v=()=>{f||xf()||(g&&(clearTimeout(g),g=null),b())};return document.addEventListener("visibilitychange",v),b(),()=>{f=!0,m?.abort(),g&&clearTimeout(g),document.removeEventListener("visibilitychange",v)}},[u]),{error:i,summary:a}},Fw=t=>{const{t:a}=Se(),o=tn(),[i,l]=y.useState(!1);return{copyingRecap:i,handleCopyRecap:()=>{if(i)return;l(!0);const f=BN(t).then(p=>p.markdown);aw(f).then(()=>o.show({kind:"success",message:a("actionCenter.recapCopied")})).catch(()=>o.show({kind:"error",message:a("actionCenter.recapCopyFailed")})).finally(()=>l(!1))}}},Km=t=>{const a=t?.recentActivity[0]??null,o=a?Fm(a):null,i=t?.attention.slice(0,5)??[],l=t?.workers.filter(f=>f.currentDispatch||f.latestReport||f.terminalHint||f.status==="working").slice(0,6)??[],u=t?.recentActivity.slice(0,6)??[];return{attention:i,evidenceWorkers:l,latest:a,latestDetail:o,recentActivity:u}},z_=t=>t==="reported"?"green":t==="cancelled"?"red":t==="queued"?"orange":"accent",H_=({copyingRecap:t,onCopyRecap:a,onOpenWorker:o,summary:i})=>{const{t:l}=Se(),{attention:u,evidenceWorkers:f,recentActivity:p}=Km(i);return c.jsxs("div",{className:"mt-2 grid gap-2 md:grid-cols-2","data-testid":"action-center-evidence",children:[c.jsx("div",{className:"flex min-w-0 justify-end md:col-span-2",children:c.jsxs("button",{type:"button",onClick:a,disabled:t,className:"inline-flex items-center gap-1.5 rounded border border-bright/40 px-2 py-1 text-xs text-sec hover:bg-2 hover:text-pri disabled:cursor-default disabled:opacity-60","data-testid":"action-center-copy-recap",children:[c.jsx(Nr,{size:12,"aria-hidden":!0}),l("actionCenter.copyRecap")]})}),u.length>0?c.jsxs("div",{className:"min-w-0 md:col-span-2",children:[c.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-ter",children:l("actionCenter.attention")}),c.jsx("ul",{className:"flex flex-col gap-px rounded border border-bright/40 bg-0",children:u.map(g=>c.jsx("li",{children:c.jsxs("div",{className:"flex min-w-0 items-center gap-2 px-2 py-1.5 text-xs","data-testid":`action-center-attention-${oc(g)}`,children:[c.jsx("span",{className:"inline-block h-1.5 w-1.5 shrink-0 rounded-full",style:{background:g.severity==="error"?"var(--status-red)":g.severity==="warning"?"var(--status-orange)":"var(--text-tertiary)"},"aria-hidden":!0}),c.jsx("span",{className:"min-w-0 truncate text-sec",title:Qf(g,l),children:Qf(g,l)})]})},oc(g)))})]}):null,c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-ter",children:l("actionCenter.recent")}),p.length>0?c.jsx("ul",{className:"flex max-h-36 flex-col gap-px overflow-auto rounded border border-bright/40 bg-0",children:p.map(g=>{const m=Fm(g);return c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>o?.(g.toAgentId),className:"flex w-full min-w-0 items-center gap-2 px-2 py-1.5 text-left text-xs hover:bg-2 disabled:cursor-default disabled:hover:bg-transparent",disabled:!o,"data-testid":`action-center-activity-${g.id}`,children:[c.jsx("span",{className:"shrink-0 text-sec",children:rc(g,l)}),m?c.jsx("span",{className:"min-w-0 truncate text-ter",title:m,children:m}):null]})},g.id)})}):c.jsx("div",{className:"rounded border border-dashed border-bright/40 px-2 py-2 text-xs text-ter",children:l("actionCenter.noActivity")})]}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-ter",children:l("actionCenter.workers")}),f.length>0?c.jsx("ul",{className:"flex max-h-36 flex-col gap-px overflow-auto rounded border border-bright/40 bg-0",children:f.map(g=>{const m=Iw(g);return c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>o?.(g.id),className:"flex w-full min-w-0 items-center gap-2 px-2 py-1.5 text-left text-xs hover:bg-2 disabled:cursor-default disabled:hover:bg-transparent",disabled:!o,"data-testid":`action-center-worker-${g.id}`,children:[c.jsx("span",{className:"min-w-0 flex-1 truncate text-sec",children:g.name}),c.jsx("span",{className:"shrink-0 text-ter",children:qw(g,l)}),m?c.jsx("span",{className:"min-w-0 flex-[1.4] truncate text-ter",title:m,children:m}):null]})},g.id)})}):c.jsx("div",{className:"rounded border border-dashed border-bright/40 px-2 py-2 text-xs text-ter",children:l("actionCenter.noWorkerEvidence")})]})]})},Ll=({icon:t,label:a,tone:o="neutral",value:i})=>c.jsxs("div",{className:"action-center-metric","data-tone":o,children:[c.jsx("div",{className:"action-center-metric__icon","aria-hidden":!0,children:t}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"mono text-lg font-semibold leading-none text-pri",children:i}),c.jsx("div",{className:"mt-1 truncate text-[11px] font-medium text-ter",children:a})]})]}),B_=({copyingRecap:t,error:a,onClose:o,onCopyRecap:i,onOpenWorker:l,open:u,summary:f})=>{const{t:p}=Se(),g=xt(),{attention:m,evidenceWorkers:b,latest:v,latestDetail:k,recentActivity:S}=Km(f),E=w=>{l?.(w),o()};return c.jsx(Oo,{open:u,onOpenChange:w=>!w&&o(),children:c.jsxs(Do,{children:[c.jsx(Mo,{"data-testid":"action-center-overlay",className:"app-overlay fixed inset-0 z-40"}),c.jsx("div",{className:"pointer-events-none fixed inset-0 z-50 grid place-items-center p-4",children:c.jsxs(Lo,{"data-testid":"action-center-drawer","aria-label":p("actionCenter.title"),"data-mobile":g||void 0,className:"dialog-scale-pop elev-2 pointer-events-auto flex flex-col rounded-lg border",style:g?{background:"var(--bg-1)",borderColor:"var(--border-bright)"}:{background:"var(--bg-1)",borderColor:"var(--border-bright)",height:"min(720px, calc(100vh - 48px))",width:"min(820px, calc(100vw - 48px))"},children:[c.jsxs("header",{className:"flex items-center justify-between gap-3 border-b px-4 py-2",style:{borderColor:"var(--border)"},children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs(zo,{className:"flex items-center gap-2 text-base font-semibold text-pri",children:[c.jsx(gc,{size:17,className:"text-accent","aria-hidden":!0}),p("actionCenter.title")]}),c.jsx(oi,{className:"text-xs text-ter",children:p("actionCenter.subtitle")})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[c.jsx(et,{label:p("actionCenter.copyRecap"),children:c.jsxs("button",{type:"button",onClick:i,disabled:t||!f,className:"drawer-action-btn pointer-coarse:min-h-10","data-testid":"action-center-copy-recap",children:[t?c.jsx(Va,{size:14,className:"animate-spin"}):c.jsx(Nr,{size:14}),c.jsx("span",{className:"hidden sm:inline",children:p("actionCenter.copyRecap")})]})}),c.jsx(et,{label:p("common.close"),children:c.jsx("button",{type:"button",onClick:o,"aria-label":p("common.close"),className:"icon-btn pointer-coarse:min-h-11 pointer-coarse:min-w-11",children:c.jsx(Ga,{size:14})})})]})]}),c.jsxs("div",{className:"scroll-y min-h-0 flex-1 px-4 py-4",children:[a?c.jsxs("div",{className:"action-center-alert action-center-alert--error",children:[c.jsx($s,{size:15,"aria-hidden":!0}),c.jsx("span",{children:p("actionCenter.loadFailed")})]}):null,f?c.jsxs("div",{className:"space-y-4",children:[c.jsxs("section",{className:"action-center-hero","data-state":m.length>0?"attention":"calm",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsxs("span",{className:"action-center-kicker",children:[c.jsx(fy,{size:13,"aria-hidden":!0}),p("actionCenter.liveSnapshot")]}),c.jsx("span",{className:"text-[11px] text-ter",children:p("actionCenter.updated",{ago:Ww(f.generatedAt,p)})})]}),c.jsx("p",{className:"mt-2 text-sm font-medium text-pri",children:v?rc(v,p):p("actionCenter.noActivity")}),k?c.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-sec",title:k,children:k}):null]}),c.jsx("div",{className:"action-center-hero__status",children:m.length>0?p("actionCenter.needsAttention",{count:m.length}):p("actionCenter.allClear")})]}),c.jsxs("section",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-4","aria-label":p("actionCenter.metrics"),children:[c.jsx(Ll,{icon:c.jsx(wc,{size:15}),label:p("actionCenter.totalWorkers"),value:f.summary.totalWorkers}),c.jsx(Ll,{icon:c.jsx(fy,{size:15}),label:p("actionCenter.workingWorkers"),tone:"green",value:f.summary.workingWorkers}),c.jsx(Ll,{icon:c.jsx(qS,{size:15}),label:p("actionCenter.openDispatches"),tone:f.summary.openDispatches>0?"orange":"neutral",value:f.summary.openDispatches}),c.jsx(Ll,{icon:c.jsx(Zb,{size:15}),label:p("actionCenter.recentReports"),tone:"accent",value:f.summary.recentReports})]}),c.jsxs("section",{className:"grid gap-3 lg:grid-cols-[1fr_1fr]",children:[c.jsxs("div",{className:"action-center-panel lg:col-span-2",children:[c.jsx("div",{className:"action-center-panel__header",children:c.jsxs("div",{children:[c.jsx("h3",{children:p("actionCenter.attention")}),c.jsx("p",{children:p("actionCenter.attentionSubtitle")})]})}),m.length>0?c.jsx("ul",{className:"space-y-2",children:m.map(w=>c.jsx("li",{children:c.jsxs("div",{className:"action-center-attention-row","data-severity":w.severity,"data-testid":`action-center-attention-${oc(w)}`,children:[c.jsx($s,{size:14,"aria-hidden":!0}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:Qf(w,p)})]})},oc(w)))}):c.jsx("div",{className:"action-center-empty",children:p("actionCenter.noAttention")})]}),c.jsxs("div",{className:"action-center-panel",children:[c.jsx("div",{className:"action-center-panel__header",children:c.jsxs("div",{children:[c.jsx("h3",{children:p("actionCenter.recent")}),c.jsx("p",{children:p("actionCenter.recentSubtitle")})]})}),S.length>0?c.jsx("ul",{className:"space-y-1.5",children:S.map(w=>{const C=Fm(w);return c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>E(w.toAgentId),className:"action-center-list-row","data-tone":z_(w.kind),disabled:!l,"data-testid":`action-center-activity-${w.id}`,children:[c.jsx("span",{className:"action-center-row-dot","aria-hidden":!0}),c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsx("span",{className:"block truncate text-xs font-medium text-pri",children:rc(w,p)}),C?c.jsx("span",{className:"block truncate text-[11px] text-ter",children:C}):null]})]})},w.id)})}):c.jsx("div",{className:"action-center-empty",children:p("actionCenter.noActivity")})]}),c.jsxs("div",{className:"action-center-panel",children:[c.jsx("div",{className:"action-center-panel__header",children:c.jsxs("div",{children:[c.jsx("h3",{children:p("actionCenter.workers")}),c.jsx("p",{children:p("actionCenter.workersSubtitle")})]})}),b.length>0?c.jsx("ul",{className:"space-y-1.5",children:b.map(w=>{const C=Iw(w);return c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>E(w.id),className:"action-center-list-row","data-tone":w.status==="working"?"green":"neutral",disabled:!l,"data-testid":`action-center-worker-${w.id}`,children:[c.jsx("span",{className:"action-center-worker-avatar","aria-hidden":!0,children:c.jsx(qE,{size:13})}),c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[c.jsx("span",{className:"truncate text-xs font-medium text-pri",children:w.name}),c.jsx("span",{className:"shrink-0 text-[11px] text-ter",children:qw(w,p)})]}),C?c.jsx("span",{className:"block truncate text-[11px] text-ter",children:C}):null]})]})},w.id)})}):c.jsx("div",{className:"action-center-empty",children:p("actionCenter.noWorkerEvidence")})]})]})]}):c.jsxs("div",{className:"flex h-[320px] items-center justify-center text-ter",children:[c.jsx(Va,{size:18,className:"animate-spin"}),c.jsx("span",{className:"ml-2 text-sm",children:p("actionCenter.loading")})]})]})]})})]})})},U_=({onOpenWorker:t,workspaceId:a})=>{const{t:o}=Se(),{error:i,summary:l}=Pw(a),{copyingRecap:u,handleCopyRecap:f}=Fw(a),[p,g]=y.useState(!1);return c.jsxs(c.Fragment,{children:[c.jsx(et,{label:o(p?"actionCenter.collapse":"actionCenter.expand"),children:c.jsxs("button",{type:"button",onClick:()=>g(m=>!m),"aria-expanded":p,"aria-haspopup":"dialog","aria-label":o(p?"actionCenter.collapse":"actionCenter.expand"),"data-testid":"topbar-action-center",className:"flex h-7 cursor-pointer items-center gap-1 rounded border px-2 text-xs font-medium text-ter transition-colors hover:bg-3 hover:text-pri focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)]",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:[c.jsx(gc,{size:13,"aria-hidden":!0}),c.jsx("span",{children:o("actionCenter.title")}),l&&l.summary.workingWorkers>0?c.jsx("span",{className:"mono rounded bg-3 px-1 text-[11px] text-accent",children:l.summary.workingWorkers}):null]})}),c.jsx(B_,{copyingRecap:u,error:i,onClose:()=>g(!1),onCopyRecap:f,onOpenWorker:t,open:p,summary:l})]})},W_=({onOpenWorker:t,workspaceId:a})=>{const{t:o}=Se(),{error:i,summary:l}=Pw(a),{copyingRecap:u,handleCopyRecap:f}=Fw(a),[p,g]=y.useState(!1),{latest:m,latestDetail:b}=Km(l);return c.jsxs("section",{className:"shrink-0 border-b px-4 py-2","data-testid":"action-center-strip",style:{background:"var(--bg-1)",borderColor:"var(--border)"},children:[c.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[c.jsxs("button",{type:"button",onClick:()=>g(v=>!v),"aria-expanded":p,"aria-label":o(p?"actionCenter.collapse":"actionCenter.expand"),className:"inline-flex items-center gap-1.5 rounded px-1 py-0.5 text-xs font-semibold uppercase tracking-wide text-ter hover:bg-3 hover:text-pri",children:[p?c.jsx(_o,{size:13,"aria-hidden":!0}):c.jsx(vc,{size:13,"aria-hidden":!0}),c.jsx(gc,{size:13,"aria-hidden":!0}),o("actionCenter.title")]}),c.jsx("span",{className:"pill pill--green",children:o("actionCenter.runningCount",{count:l?.summary.workingWorkers??0})}),c.jsx("span",{className:"pill pill--ghost",children:o("actionCenter.reportCount",{count:l?.summary.recentReports??0})})]}),c.jsx("div",{className:"mt-1 flex min-w-0 items-center gap-1.5 text-xs text-sec",children:i?c.jsx("span",{style:{color:"var(--text-error)"},children:o("actionCenter.loadFailed")}):m?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"shrink-0 text-ter",children:rc(m,o)}),b?c.jsxs("span",{className:"min-w-0 truncate text-ter",title:b,children:["· ",b]}):null]}):c.jsx("span",{className:"text-ter",children:o(l?"actionCenter.noActivity":"actionCenter.loading")})}),p&&l?c.jsx(H_,{copyingRecap:u,onCopyRecap:f,onOpenWorker:t,summary:l}):null]})};let sc=!1;const Jf=new Set,I_=()=>sc,Kw=t=>{if(sc!==t){sc=t;for(const a of Jf)a()}},q_=()=>{Kw(!sc)},P_=t=>(Jf.add(t),()=>Jf.delete(t)),Yw=()=>y.useSyncExternalStore(P_,I_,()=>!1),$w="hive.notification.settings",go={desktop:!1,detail:"brief",sound:"soft"},F_={beacon:"/sounds/hive-beacon.ogg",cascade:"/sounds/hive-cascade.ogg",chime:"/sounds/hive-chime.ogg",ping:"/sounds/hive-ping.ogg",resolve:"/sounds/hive-resolve.ogg",soft:"/sounds/hive-soft.ogg"},K_=t=>t==="off"||t==="ping"||t==="chime"||t==="soft"||t==="cascade"||t==="beacon"||t==="resolve",Y_=()=>{if(typeof window>"u")return go;try{const t=window.localStorage.getItem($w);if(!t)return go;const a=JSON.parse(t);return{desktop:typeof a.desktop=="boolean"?a.desktop:go.desktop,detail:a.detail==="detailed"?"detailed":go.detail,sound:K_(a.sound)?a.sound:go.sound}}catch{return go}},$_=t=>{try{window.localStorage.setItem($w,JSON.stringify(t))}catch{}},Wy=t=>{if(!(t==="off"||typeof window>"u"))try{const a=new window.Audio(F_[t]);a.preload="auto",a.volume=.72,a.play()?.catch(()=>{})}catch{}},Vw=y.createContext(null),V_=({children:t})=>{const a=tn(),{t:o}=Se(),[i,l]=y.useState(()=>Y_());y.useEffect(()=>{$_(i)},[i]);const u=y.useCallback(b=>{l(v=>({...v,...b}))},[]),f=y.useCallback(async()=>{if(typeof window>"u"||!("Notification"in window))return u({desktop:!1}),a.show({kind:"warning",message:o("notifications.toast.unsupported")}),!1;if(window.Notification.permission==="granted")return u({desktop:!0}),!0;if(window.Notification.permission==="denied")return u({desktop:!1}),a.show({kind:"warning",message:o("notifications.toast.blocked")}),!1;const v=await window.Notification.requestPermission()==="granted";return u({desktop:v}),v||a.show({kind:"warning",message:o("notifications.toast.declined")}),v},[o,a,u]),p=y.useCallback(({brief:b,detail:v,kind:k,title:S})=>{const E=i.detail==="detailed"&&v?v:b;if(a.show({kind:k,message:E}),Wy(i.sound),i.desktop&&typeof window<"u"&&"Notification"in window&&window.Notification.permission==="granted")try{new window.Notification(S,{body:E})}catch{}},[i,a]),g=y.useCallback(b=>{Wy(b)},[]),m=y.useMemo(()=>({notify:p,previewSound:g,requestDesktopNotifications:f,settings:i,updateSettings:u}),[p,g,f,i,u]);return c.jsx(Vw.Provider,{value:m,children:t})},Rc=()=>{const t=y.useContext(Vw);if(!t)throw new Error("useNotifications must be used within NotificationProvider");return t},G_={coder:"role.coder",custom:"role.custom",reviewer:"role.reviewer",sentinel:"role.sentinel",tester:"role.tester"},X_=t=>new Map(t.map(a=>[a.id,{id:a.id,name:a.name,pendingTaskCount:a.pendingTaskCount,role:a.role,status:a.status}])),Z_=({terminalRuns:t,workers:a,workspace:o})=>{const{notify:i}=Rc(),{t:l}=Se(),u=y.useRef(null);return y.useEffect(()=>{if(!o){u.current=null;return}const f=X_(a),p=u.current;if(u.current={workers:f,workspaceId:o.id},!(!p||p.workspaceId!==o.id))for(const g of f.values()){const m=p.workers.get(g.id);if(!m)continue;if(m.status!=="stopped"&&g.status==="stopped"){i({brief:l("notifications.workerStopped.brief",{name:g.name}),detail:l("notifications.workerStopped.detail",{name:g.name,workspace:o.name}),kind:"error",title:l("notifications.workerStopped.title")});continue}if(m.status==="stopped"&&g.status!=="stopped"){i({brief:l("notifications.workerStarted.brief",{name:g.name}),detail:l("notifications.workerStarted.detail",{name:g.name,workspace:o.name,role:l(G_[g.role])}),kind:"success",title:l("notifications.workerStarted.title")});continue}(g.pendingTaskCount<m.pendingTaskCount||m.status==="working"&&g.status==="idle")&&i({brief:l("notifications.workerReported.brief",{name:g.name}),detail:l("notifications.workerReported.detail",{name:g.name,workspace:o.name}),kind:"success",title:l("notifications.workerReported.title")})}},[i,l,a,o]),null},Q_=({tabs:t,activeId:a,onSelect:o,onClose:i,onClosePanel:l,onNewShell:u,newShellPending:f})=>{const{t:p}=Se();return c.jsxs("div",{role:"tablist","aria-label":p("terminalPanel.tablistAria"),className:"scrollbar-thin flex h-9 min-h-9 w-full items-stretch overflow-x-auto pointer-coarse:h-12 pointer-coarse:min-h-12",style:{background:"var(--bg-2)",borderBottom:"1px solid var(--border)"},"data-testid":"terminal-tab-strip",children:[t.map(g=>{const m=g.id===a,b=p("terminalPanel.closeTab",{name:g.label}),v=k=>{k.stopPropagation(),i(g.id)};return c.jsxs("div",{role:"tab","aria-selected":m,"data-testid":`terminal-tab-${g.id}`,onClick:()=>o(g.id),className:"group relative flex max-w-[200px] shrink-0 cursor-pointer items-center gap-1.5 border-r text-xs",style:{background:m?"var(--bg-1)":"transparent",borderRightColor:"var(--border)",color:m?"var(--text-primary)":"var(--text-secondary)"},children:[m?c.jsx("span",{"data-tab-accent":!0,"aria-hidden":!0,className:"pointer-events-none absolute top-0 right-0 left-0 h-0.5",style:{background:"var(--accent)"}}):null,c.jsxs("button",{type:"button","data-testid":`terminal-tab-select-${g.id}`,onClick:k=>{k.stopPropagation(),o(g.id)},className:"flex min-w-0 flex-1 items-center gap-1.5 py-2 pr-1 pl-3 text-left",style:{color:"inherit"},children:[c.jsx(yc,{size:12,"aria-hidden":!0}),c.jsx("span",{className:"truncate",children:g.label})]}),c.jsx(et,{label:b,children:c.jsx("button",{type:"button","aria-label":b,"data-testid":`terminal-tab-close-${g.id}`,onClick:v,className:`mr-1 rounded p-0.5 pointer-coarse:p-2 transition ${m?"opacity-100":"opacity-0 group-hover:opacity-100 pointer-coarse:opacity-100"}`,style:{color:"var(--text-secondary)"},children:c.jsx(Ga,{size:12,"aria-hidden":!0})})})]},g.id)}),c.jsxs("div",{className:"flex flex-1 items-center justify-end gap-1 px-2",children:[c.jsx(et,{label:p("terminalPanel.closePanel"),children:c.jsx("button",{type:"button","aria-label":p("terminalPanel.closePanel"),"data-testid":"terminal-panel-close",onClick:l,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded border text-sec transition hover:text-pri disabled:opacity-50 pointer-coarse:h-10 pointer-coarse:w-10",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:c.jsx(Ga,{size:12,"aria-hidden":!0})})}),c.jsx(et,{label:p("terminalPanel.newShell"),children:c.jsx("button",{type:"button","aria-label":p("terminalPanel.newShell"),"data-testid":"terminal-tab-new-shell",onClick:u,disabled:f,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded border text-sec transition hover:text-pri disabled:opacity-50 pointer-coarse:h-10 pointer-coarse:w-10",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:f?c.jsx(Va,{size:12,className:"animate-spin","aria-hidden":!0}):c.jsx(Xl,{size:12,"aria-hidden":!0})})})]})]})},Gw="hive.terminal-panel.height",Xw="hive.terminal-panel.collapsed",em=160,J_=.35,eA=160,qs=t=>{const a=typeof window<"u"?window.innerHeight:800,o=Math.max(em,a-eA);return Math.min(Math.max(t,em),o)},kf=()=>{const t=typeof window<"u"?window.innerHeight:800;return qs(Math.floor(t*J_))},tA=()=>{try{const t=window.localStorage.getItem(Gw);if(!t)return kf();const a=Number.parseInt(t,10);return Number.isFinite(a)?qs(a):kf()}catch{return kf()}},nA=()=>{try{return window.localStorage.getItem(Xw)==="1"}catch{return!1}},aA=()=>{const[t,a]=y.useState(()=>tA()),[o,i]=y.useState(()=>nA()),[l,u]=y.useState(!1);y.useEffect(()=>{try{window.localStorage.setItem(Gw,String(Math.round(t)))}catch{}},[t]),y.useEffect(()=>{try{window.localStorage.setItem(Xw,o?"1":"0")}catch{}},[o]),y.useEffect(()=>{const m=()=>a(b=>qs(b));return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);const f=y.useCallback(m=>a(qs(m)),[]),p=y.useCallback(m=>i(m),[]),g=y.useCallback(m=>{m.preventDefault();const b=m.clientY;let v=t;a(C=>(v=C,C)),u(!0);const k=document.body.style.cursor,S=document.body.style.userSelect;document.body.style.cursor="ns-resize",document.body.style.userSelect="none";const E=C=>{const T=C.clientY-b;a(qs(v-T))},w=()=>{u(!1),document.body.style.cursor=k,document.body.style.userSelect=S,document.removeEventListener("pointermove",E),document.removeEventListener("pointerup",w),document.removeEventListener("pointercancel",w)};document.addEventListener("pointermove",E),document.addEventListener("pointerup",w),document.addEventListener("pointercancel",w)},[t]);return{height:t,collapsed:o,dragging:l,setHeight:f,setCollapsed:p,beginDrag:g}},rA=(t,a)=>a?t.find(o=>o.id===a)??null:null,oA=({tabs:t,activeId:a,onSelect:o,onClose:i,onClosePanel:l,onNewShell:u,newShellPending:f,onStartWorker:p,startingWorkerId:g})=>{const{t:m}=Se(),b=aA(),v=xt();if(t.length===0)return null;const k=rA(t,a)??t[0]??null;return c.jsxs("div",{"data-testid":"terminal-bottom-panel",className:"relative flex shrink-0 flex-col",style:{height:v?"45%":b.height,minHeight:v?"min(160px, 60%)":void 0,background:"var(--bg-1)",borderTop:"1px solid var(--border)"},tabIndex:-1,onKeyDown:S=>{(S.metaKey||S.ctrlKey)&&!S.altKey&&!S.shiftKey&&S.key.toLowerCase()==="w"&&a&&(S.preventDefault(),i(a))},children:[v?null:c.jsx("div",{role:"separator","aria-orientation":"horizontal","aria-label":m("terminalPanel.resizeAria"),"aria-valuemin":em,"aria-valuenow":Math.round(b.height),className:"absolute top-0 right-0 left-0 z-10 h-2 -translate-y-1 cursor-ns-resize",tabIndex:-1,"data-resizing":b.dragging||void 0,"data-testid":"terminal-panel-resize-handle",onPointerDown:b.beginDrag}),c.jsx(Q_,{tabs:t,activeId:k?.id??null,onSelect:o,onClose:i,onClosePanel:l,onNewShell:u,newShellPending:f}),c.jsx("div",{className:"relative min-h-0 flex-1",style:{background:"var(--bg-crust)"},children:t.map(S=>c.jsx(sA,{tab:S,isActive:S.id===(k?.id??null),onStartWorker:p,startingWorkerId:g},S.id))})]})},sA=({tab:t,isActive:a,onStartWorker:o,startingWorkerId:i})=>{const{t:l}=Se(),u=a?"flex h-full w-full":"hidden";if(t.kind==="worker"){if(!t.runId){const f=i===t.workerId;return c.jsxs("div",{className:a?"flex h-full w-full flex-col items-center justify-center gap-3 px-6 text-center text-xs text-ter":"hidden","data-testid":"terminal-panel-stopped-worker",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(yc,{size:14,"aria-hidden":!0}),l("terminalPanel.workerStopped",{name:t.label})]}),c.jsxs("button",{type:"button",onClick:()=>o(t.workerId),disabled:f,className:"icon-btn icon-btn--primary","data-testid":"terminal-panel-start-worker",children:[f?c.jsx(Va,{size:12,className:"animate-spin","aria-hidden":!0}):c.jsx(Ao,{size:12,"aria-hidden":!0}),l(f?"common.starting":"common.start")]})]})}return c.jsx("div",{id:`worker-pty-${t.runId}`,className:u,"data-pty-slot":"worker","data-testid":`terminal-panel-slot-worker-${t.workerId}`})}return c.jsx("div",{id:`shell-pty-${t.runId}`,className:u,"data-pty-slot":"shell","data-testid":`terminal-panel-slot-shell-${t.runId}`})},Sf=t=>`hive.terminal-panel.tabs.${t}`,Ef=t=>`hive.terminal-panel.active.${t}`,iA=t=>`worker:${t}`,lA=t=>`shell:${t}`,Iy=t=>{try{const a=window.localStorage.getItem(t);if(!a)return[];const o=JSON.parse(a);return Array.isArray(o)?o.filter(i=>typeof i=="string"):[]}catch{return[]}},qy=t=>{try{return window.localStorage.getItem(t)??""}catch{return""}},Py=(t,a)=>{try{window.localStorage.setItem(t,a)}catch{}},cA=({workspaceId:t,workers:a,terminalRuns:o})=>{const[i,l]=y.useState(()=>Iy(Sf(t))),[u,f]=y.useState(()=>{const N=qy(Ef(t));return N.length>0?N:null}),p=y.useRef(i);p.current=i;const g=y.useRef(t);y.useEffect(()=>{if(g.current===t)return;g.current=t,l(Iy(Sf(t)));const N=qy(Ef(t));f(N.length>0?N:null)},[t]);const m=y.useRef(!1);y.useEffect(()=>{m.current=a.length>0||o.length>0},[t]),y.useEffect(()=>{(a.length>0||o.length>0)&&(m.current=!0)},[a,o]),y.useEffect(()=>{m.current&&Py(Sf(t),JSON.stringify(i))},[i,t]),y.useEffect(()=>{m.current&&Py(Ef(t),u??"")},[u,t]);const b=y.useMemo(()=>new Map(a.map(N=>[N.id,N])),[a]),{runByAgentId:v,shellRunById:k}=y.useMemo(()=>{const N=new Map,A=new Map;for(const j of o)N.set(j.agent_id,j),Gs(j,t)&&A.set(j.run_id,j);return{runByAgentId:N,shellRunById:A}},[o,t]),S=y.useMemo(()=>{const N=[];for(const A of i)if(A.startsWith("worker:")){const j=A.slice(7),O=b.get(j);if(!O)continue;const D=v.get(O.id);N.push({id:A,kind:"worker",workerId:j,runId:D?.run_id??null,label:O.name})}else if(A.startsWith("shell:")){const j=A.slice(6),O=k.get(j);if(!O)continue;N.push({id:A,kind:"shell",runId:j,label:O.agent_name})}return N},[i,b,v,k]);y.useEffect(()=>{m.current&&l(N=>{const A=N.filter(j=>j.startsWith("worker:")?b.has(j.slice(7)):j.startsWith("shell:")?k.has(j.slice(6)):!1);return A.length===N.length?N:A})},[b,k]),y.useEffect(()=>{m.current&&(u&&S.some(N=>N.id===u)||f(S[0]?.id??null))},[u,S]);const E=y.useCallback(N=>{m.current=!0;const A=iA(N);l(j=>j.includes(A)?j:[...j,A]),f(A)},[]),w=y.useCallback(N=>{m.current=!0;const A=lA(N);l(j=>j.includes(A)?j:[...j,A]),f(A)},[]),C=y.useCallback(N=>{const A=p.current,j=A.filter(O=>O!==N);j.length!==A.length&&(l(j),f(O=>{if(O!==N)return O;const D=A.indexOf(N);return j[D]??j[D-1]??j[0]??null}))},[]),T=y.useCallback(N=>f(N),[]);return{tabs:S,activeId:u,openWorkerTab:E,openShellTab:w,closeTab:C,setActive:T}},Fy=500,uA=2500,dA=5e3,fA=t=>t.status==="starting"||t.status==="running",mA=(t,a)=>t>0?Math.min(Fy*2**t,dA):a.some(fA)?Fy:uA,Ym=t=>`${t}:orchestrator`,pA=(t,a)=>t.length!==a.length?!1:t.every((o,i)=>{const l=a[i];return l!==void 0&&o.agent_id===l.agent_id&&o.agent_name===l.agent_name&&o.run_id===l.run_id&&o.status===l.status&&o.terminal_input_profile===l.terminal_input_profile}),hA=t=>{const[a,o]=y.useState([]);return y.useEffect(()=>{if(!t){o([]);return}let i=!1,l=0,u=!1,f=[],p;const g=()=>{i||(p=window.setTimeout(m,mA(l,f)))},m=()=>{u||(u=!0,dN(t).then(b=>{i||(l=0,f=b,o(v=>pA(v,b)?v:b))}).catch(b=>{i||(l=Math.min(l+1,4),o(v=>v.length===0?v:[])),console.error("[hive] swallowed:terminalRuns.list",b)}).finally(()=>{u=!1,g()}))};return m(),()=>{i=!0,p!==void 0&&window.clearTimeout(p)}},[t]),a},gA=(t,a)=>t.find(o=>o.agent_id===Ym(a)),vA=(t,a)=>t.find(o=>o.agent_id===a),yA=({onCloseFailed:t,onShellRunClosed:a,onShellRunStarted:o,panelTabs:i,shellRuns:l,workspaceId:u})=>{const[f,p]=y.useState(null),[g,m]=y.useState(null),[b,v]=y.useState(!1),k=y.useRef(new Map),S=y.useRef(0),E=y.useRef(new Map),w=y.useRef(new Map),C=y.useRef(new Set),T=y.useRef(u),A=(l.find(W=>W.run_id===g)??l[0]??null)?.run_id??null,j=y.useCallback((W,ee)=>{const Q=E.current.get(W)??new Set;Q.add(ee),E.current.set(W,Q)},[]),O=y.useCallback((W,ee,Q)=>{const V=w.current.get(W)??new Map;V.set(ee,Q),w.current.set(W,V),Q.finally(()=>{const M=w.current.get(W);M&&(M.delete(ee),M.size===0&&w.current.delete(W))}).catch(()=>{})},[]),D=y.useCallback((W,ee)=>{const Q=E.current.get(W);Q&&(Q.delete(ee),Q.size===0&&E.current.delete(W))},[]);y.useLayoutEffect(()=>{T.current=u},[u]),y.useEffect(()=>()=>{E.current.clear(),w.current.clear(),C.current.clear()},[]),y.useEffect(()=>{p(null),m(null),v(!1)},[u]),y.useEffect(()=>{if(!u)return;const W=E.current.get(u);if(!W)return;const ee=new Set(l.map(V=>V.run_id)),Q=w.current.get(u);for(const V of Array.from(W))Q?.has(V)||ee.has(V)||D(u,V)},[l,D,u]);const L=()=>{if(!u||k.current.has(u))return;const W=u,ee=S.current+1;S.current=ee,k.current.set(W,ee);const Q=()=>T.current===W,V=()=>k.current.get(W)===ee;p(null),v(!0),sN(W).then(M=>{o?.(W,M),Q()&&(m(M.run_id),i.openShellTab(M.run_id))}).catch(M=>{Q()&&p(M instanceof Error?M.message:String(M))}).finally(()=>{V()&&k.current.delete(W),Q()&&v(!1)})},q=()=>{if(!u||k.current.has(u)||C.current.has(u))return;const W=u,ee=Array.from(w.current.get(W)?.values()??[]);if(ee.length===0){L();return}C.current.add(W),p(null),v(!0),Promise.allSettled(ee).then(Q=>{Q.some(V=>V.status==="rejected")||T.current===W&&(k.current.has(W)||L())}).finally(()=>{C.current.delete(W),T.current===W&&!k.current.has(W)&&v(!1)})};return{closeShellTab:W=>{if(!u)return;const ee=l.find(V=>V.run_id!==W)??null;A===W&&m(ee?.run_id??null),a?.(u,W),j(u,W);const Q=iN(u,W).catch(V=>{throw D(u,W),t(V instanceof Error?V.message:String(V)),V});O(u,W,Q),Q.catch(()=>{})},openShell:()=>{if(!u||k.current.has(u)||b)return;const W=i.tabs.find(V=>V.kind==="shell");if(W){i.setActive(W.id);return}const ee=E.current.get(u)??new Set,Q=l.find(V=>!ee.has(V.run_id));if(Q){m(Q.run_id),i.openShellTab(Q.run_id);return}if(ee.size>0){q();return}L()},shellError:f,shellStarting:b,startNewShell:()=>{if(!u||k.current.has(u)||b)return;if((E.current.get(u)??new Set).size>0){q();return}L()}}},Zw="hive.split.orch-pct",Us=.3,Ws=.78,Fl=.6,Ky=.02,Kl=(t,a,o)=>Math.min(o,Math.max(a,t)),bA=()=>{try{const t=localStorage.getItem(Zw);if(!t)return Fl;const a=Number.parseFloat(t);return Number.isFinite(a)?Kl(a,Us,Ws):Fl}catch{return Fl}},wA=()=>{const t=y.useRef(null),[a,o]=y.useState(()=>bA()),[i,l]=y.useState(!1);y.useEffect(()=>{try{localStorage.setItem(Zw,a.toFixed(4))}catch{}},[a]);const u=y.useCallback(p=>{p.preventDefault();const g=t.current;if(!g)return;l(!0);const m=document.body.style.userSelect,b=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const v=S=>{const E=g.getBoundingClientRect();if(E.width<=0)return;const w=(S.clientX-E.left)/E.width;o(Kl(w,Us,Ws))},k=()=>{l(!1),document.body.style.userSelect=m,document.body.style.cursor=b,document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",k),document.removeEventListener("pointercancel",k)};document.addEventListener("pointermove",v),document.addEventListener("pointerup",k),document.addEventListener("pointercancel",k)},[]),f=y.useCallback(p=>{p.key==="ArrowLeft"?(p.preventDefault(),o(g=>Kl(g-Ky,Us,Ws))):p.key==="ArrowRight"?(p.preventDefault(),o(g=>Kl(g+Ky,Us,Ws))):p.key==="Home"?(p.preventDefault(),o(Us)):p.key==="End"?(p.preventDefault(),o(Ws)):p.key==="Enter"&&(p.metaKey||p.ctrlKey)&&(p.preventDefault(),o(Fl))},[]);return{containerRef:t,orchPct:a,dragging:i,beginDrag:u,onKeyDown:f}},li=({title:t,description:a,icon:o,action:i})=>c.jsxs("div",{className:"m-auto flex max-w-[380px] flex-col items-center gap-3 px-6 py-8 text-center","data-testid":"empty-state",children:[o?c.jsx("div",{"data-testid":"empty-state-icon","aria-hidden":!0,className:"flex h-12 w-12 items-center justify-center rounded text-sec",style:{background:"var(--bg-2)",border:"1px solid var(--border-bright)"},children:o}):null,c.jsx("div",{className:"text-lg font-semibold text-pri","data-testid":"empty-state-title",children:t}),c.jsx("div",{className:"text-sm text-ter","data-testid":"empty-state-description",children:a}),i]}),Pa=t=>a=>{console.error(`[hive] swallowed:${t}`,a)},xA={agy:{command:"curl -fsSL https://antigravity.google/cli/install.sh | bash",docsUrl:"https://antigravity.google/docs/cli-getting-started"},claude:{command:"npm install -g @anthropic-ai/claude-code",docsUrl:"https://github.com/anthropics/claude-code"},codex:{command:"npm install -g @openai/codex",docsUrl:"https://github.com/openai/codex"},cursor:{command:"curl https://cursor.com/install -fsS | bash",docsUrl:"https://cursor.com/docs/cli/installation"},gemini:{command:"npm install -g @google/gemini-cli",docsUrl:"https://github.com/google-gemini/gemini-cli"},grok:{command:"curl -fsSL https://x.ai/cli/install.sh | bash",docsUrl:"https://x.ai/cli"},hermes:{command:"curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash",docsUrl:"https://github.com/NousResearch/hermes-agent"},opencode:{command:"npm install -g opencode-ai",docsUrl:"https://opencode.ai/docs"},qwen:{command:"npm install -g @qwen-code/qwen-code@latest",docsUrl:"https://github.com/QwenLM/qwen-code"}},kA=t=>xA[t]??null,SA=({presetId:t,presetName:a})=>{const{t:o}=Se(),i=kA(t),[l,u]=y.useState(!1),[f,p]=y.useState(!1),g=y.useRef(null);y.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]);const m=()=>{i&&nw(i.command).then(()=>{u(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{u(!1),g.current=null},1500)}).catch(Pa("cli-install-copy"))};return c.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border p-3",style:{background:"var(--bg-2)",borderColor:"var(--border)"},"data-testid":"cli-install-guidance",children:[i?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-xs text-sec",children:o("workspace.preset.installHint",{name:a})}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("code",{className:"mono min-w-0 flex-1 truncate rounded border px-2 py-1.5 text-xs text-pri",style:{background:"var(--bg-1)",borderColor:"var(--border)"},title:i.command,children:i.command}),c.jsxs("button",{type:"button",onClick:m,className:"icon-btn shrink-0 inline-flex items-center gap-1.5","aria-label":o("workspace.preset.installCopyAria"),"data-testid":"cli-install-copy",children:[l?c.jsx(Ja,{size:13,"aria-hidden":!0}):c.jsx(Nr,{size:13,"aria-hidden":!0}),c.jsx("span",{className:"text-xs",children:o(l?"common.copied":"workspace.preset.installCopy")})]})]}),c.jsxs("a",{href:i.docsUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 self-start text-xs text-sec underline hover:text-pri","data-testid":"cli-install-docs",children:[c.jsx(Em,{size:11,"aria-hidden":!0}),o("workspace.preset.installDocs")]})]}):null,c.jsxs("button",{type:"button",onClick:()=>p(b=>!b),"aria-expanded":f,className:"flex items-center gap-1 text-left text-xs text-sec hover:text-pri cursor-pointer","data-testid":"cli-install-path-help-toggle",children:[f?c.jsx(_o,{size:12,"aria-hidden":!0}):c.jsx(vc,{size:12,"aria-hidden":!0}),o("workspace.preset.pathHelpTitle")]}),f?c.jsx("p",{className:"text-xs leading-relaxed text-ter","data-testid":"cli-install-path-help-body",children:o("workspace.preset.pathHelpBody")}):null]})},EA={"cursor-agent":"cursor"},CA=/^(\S+) CLI not found in PATH/u,TA=()=>{const{t}=Se();return c.jsx("div",{"data-testid":"orchestrator-starting-body",className:"flex flex-1",children:c.jsx(li,{icon:c.jsx(Va,{size:24,className:"animate-spin"}),title:t("orchestrator.startingTitle"),description:t("orchestrator.startingDesc")})})},NA=({onStart:t})=>{const{t:a}=Se();return c.jsx("div",{"data-testid":"orchestrator-stopped-body",className:"flex flex-1",children:c.jsx(li,{icon:c.jsx(Sm,{size:24}),title:a("orchestrator.stoppedTitle"),description:a("orchestrator.stoppedDesc"),action:c.jsxs("button",{type:"button",onClick:t,className:"icon-btn icon-btn--primary","data-testid":"orchestrator-start",children:[c.jsx(Ao,{size:12,"aria-hidden":!0})," ",a("orchestrator.start")]})})})},jA=({error:t,onRemoveWorkspace:a,onRestart:o})=>{const{t:i}=Se(),[l,u]=y.useState(!1),f=()=>{navigator.clipboard?.writeText(t).then(()=>{u(!0),window.setTimeout(()=>u(!1),1500)}).catch(()=>{})},p=CA.exec(t)?.[1];return c.jsxs("div",{"data-testid":"orchestrator-failed-body",className:"m-auto flex max-w-[480px] flex-col items-center gap-3 px-6 py-8",children:[c.jsx("div",{"aria-hidden":!0,className:"flex h-12 w-12 items-center justify-center rounded text-sec",style:{background:"var(--bg-2)",border:"1px solid var(--border-bright)"},children:c.jsx(Sm,{size:24})}),c.jsx("div",{className:"text-lg font-semibold text-pri",children:i("orchestrator.failed")}),c.jsxs("div",{className:"relative w-full",children:[c.jsx("pre",{"data-testid":"orchestrator-error-message",className:"mono w-full max-h-40 overflow-auto whitespace-pre-wrap break-all rounded p-3 text-left text-xs",style:{background:"color-mix(in oklab, var(--status-red) 8%, var(--bg-2))",border:"1px solid color-mix(in oklab, var(--status-red) 24%, transparent)",color:"var(--text-secondary)"},children:t}),c.jsx(et,{label:i(l?"common.copied":"common.copyError"),children:c.jsx("button",{type:"button",onClick:f,"aria-label":i("orchestrator.copyErrorAria"),className:"icon-btn icon-btn--ghost absolute right-1 top-1 h-6 px-1.5","data-testid":"orchestrator-copy-error",children:c.jsx(Nr,{size:12,"aria-hidden":!0})})})]}),p?c.jsx("div",{className:"w-full",children:c.jsx(SA,{presetId:EA[p]??p,presetName:p})}):null,c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("button",{type:"button",onClick:o,className:"icon-btn icon-btn--primary","data-testid":"orchestrator-retry",children:[c.jsx(Tm,{size:12,"aria-hidden":!0})," ",i("common.retry")]}),c.jsx("button",{type:"button",onClick:a,className:"icon-btn icon-btn--danger","data-testid":"orchestrator-remove-workspace",children:i("orchestrator.removeWorkspace")})]}),c.jsx("span",{"data-testid":"orchestrator-retry-header",className:"sr-only",children:i("common.retry")})]})},_A=({state:t,onRemoveWorkspace:a,onRestart:o,onStart:i})=>{const{t:l}=Se(),u=xt();return c.jsx("div",{className:"orchestrator-pane-root relative flex h-full w-full min-w-0 flex-col",style:{background:"var(--bg-crust)",...u?{}:{borderRight:"1px solid var(--border)"}},"data-testid":"orchestrator-terminal-slot",children:t.kind==="running"?c.jsx("div",{id:`orch-pty-${t.runId}`,className:"orchestrator-pty-slot relative flex h-full w-full","data-pty-slot":"orchestrator",children:c.jsx("div",{className:"orchestrator-pty-placeholder pointer-events-none absolute inset-0 flex items-center justify-center px-4 text-center","data-testid":"orchestrator-running-placeholder",children:c.jsx("div",{className:"mono text-xs text-ter",children:l("terminal.statusConnecting")})})}):t.kind==="failed"?c.jsx(jA,{error:t.error,onRemoveWorkspace:a,onRestart:o}):t.kind==="stopped"?c.jsx(NA,{onStart:i}):c.jsx(TA,{})})},AA=({workspaceId:t,terminalRuns:a,autostartError:o,onClearAutostartError:i,onAfterStart:l,onRunClosed:u})=>{const f=gA(a,t),p=Ym(t),[g,m]=y.useState(null);y.useEffect(()=>{f&&m(null)},[f]);let b;f?b={hasUserInputSinceStart:f.has_user_input_since_start===!0,kind:"running",runId:f.run_id,startupBlockedReason:f.startup_blocked_reason??null}:g===t?b={kind:"starting"}:o?b={kind:"failed",error:o}:b={kind:"stopped"};const v=y.useCallback(()=>{!t||g===t||f||(i(),m(t),Vs(t,p).then(E=>{l?.({ok:!0,error:null,run_id:E.runId})}).catch(E=>{const w=E instanceof Error?E.message:"Failed to start Queen";l?.({ok:!1,error:w,run_id:null})}).finally(()=>m(E=>E===t?null:E)))},[p,l,i,f,g,t]),k=y.useCallback(()=>{f&&Jl(f.run_id).then(()=>{u?.(t,f.run_id)}).catch(E=>{console.error("[hive] swallowed:orchestrator.stop",E)})},[u,f,t]),S=y.useCallback(()=>{if(i(),f){Jl(f.run_id).catch(E=>{console.error("[hive] swallowed:orchestrator.restart.stop",E)}).then(()=>Vs(t,p)).then(E=>{u?.(t,f.run_id),l?.({ok:!0,error:null,run_id:E.runId})}).catch(E=>{const w=E instanceof Error?E.message:"Failed to restart Queen";l?.({ok:!1,error:w,run_id:null})});return}v()},[p,l,i,u,f,v,t]);return{state:b,start:v,stop:k,restart:S}},Qw=["ada-lovelace","archimedes","babbage","bell","da-vinci","edison","eiffel","euclid","euler","fermat","fibonacci","gutenberg","leibniz","marconi","morse","nobel","pascal","pythagoras","tesla","turing","watt","wright-brothers"],Jw=["adam-smith","aquinas","aristotle","augustine","bacon","calvin","cicero","democritus","descartes","epicurus","hegel","herodotus","hobbes","hume","kant","kierkegaard","locke","luther","machiavelli","marcus-aurelius","montesquieu","nietzsche","plato","rousseau","seneca","socrates","spinoza","voltaire"],ex=["amundsen","boyle","cook","copernicus","curie","da-gama","darwin","drake","faraday","fleming","galileo","halley","hippocrates","kepler","magellan","marco-polo","mendel","mendeleev","newton","pasteur","planck","ptolemy","rutherford","volta"],RA=["alexander","augustus","austen","bach","beethoven","brahms","byron","caesar","cervantes","charlemagne","chopin","cleopatra","dante","dickens","dostoevsky","dumas","einstein","elizabeth-i","franklin","goethe","goya","handel","hannibal","henry-viii","homer","hugo","jefferson","joan-of-arc","keats","leonidas","lincoln","liszt","louis-xiv","michelangelo","milton","monet","mozart","napoleon","nightingale","orwell","picasso","poe","raphael","rembrandt","schubert","shakespeare","sophocles","tchaikovsky","titian","tolstoy","twain","van-gogh","velazquez","verdi","vermeer","virgil","vivaldi","wagner","washington","whitman","wilde","woolf","wordsworth"],tx=["八大山人","毕昇","蔡伦","干将","顾恺之","黄道婆","李冰","柳公权","鲁班","莫邪","墨子","沈括","宋应星","唐寅","王羲之","文徵明","吴道子","颜真卿","张衡","张择端","郑板桥","祖冲之"],nx=["班固","包拯","狄仁杰","董仲舒","范仲淹","顾炎武","管仲","海瑞","韩非","韩愈","嵇康","贾谊","孔子","老子","林则徐","柳宗元","孟子","欧阳修","商鞅","司马光","司马迁","谭嗣同","王安石","王守仁","魏徵","荀子","张居正","周敦颐","朱熹","庄子"],ax=["班超","扁鹊","法显","葛洪","华佗","鉴真","郦道元","李时珍","神农","苏武","孙思邈","陶弘景","徐光启","徐霞客","玄奘","张骞","张仲景","郑和"],OA=["白居易","蔡文姬","曹操","曹雪芹","曹植","程咬金","大禹","杜甫","杜牧","范蠡","关羽","汉武帝","韩信","忽必烈","花木兰","黄帝","霍去病","姜子牙","康熙","李白","李广","李靖","李清照","李煜","刘邦","刘备","刘伯温","柳永","陆游","罗贯中","吕布","吕不韦","孟浩然","蒙恬","努尔哈赤","庞统","蒲松龄","戚继光","乾隆","秦始皇","屈原","上官婉儿","施耐庵","司马懿","苏轼","孙膑","孙权","孙武","孙中山","唐太宗","唐玄宗","陶渊明","王维","卫青","文天祥","吴承恩","吴起","萧何","谢安","辛弃疾","杨贵妃","雍正","虞姬","岳飞","张飞","张良","张仪","赵子龙","周瑜","朱棣","诸葛亮","朱元璋","左宗棠"],DA=[...Qw,...Jw,...ex,...RA],MA=[...tx,...nx,...ax,...OA],LA=["argus","cassandra","copernicus","halley","herodotus","hypatia","kepler","ptolemy","thucydides","tycho-brahe"],zA=["班固","郭守敬","沈括","司马光","司马迁","一行","张衡","祖冲之"],HA={en:{coder:Qw,reviewer:Jw,tester:ex,sentinel:LA,custom:DA},zh:{coder:tx,reviewer:nx,tester:ax,sentinel:zA,custom:MA}},BA=()=>{const t=new Uint32Array(1);return globalThis.crypto.getRandomValues(t),t[0]??0},Cf=({language:t="en",role:a="coder",usedNames:o,nextUint32:i=BA}={})=>{const l=HA[t][a],u=o&&o.size>0?l.filter(p=>!o.has(p)):l,f=u.length>0?u:l;return f[i()%f.length]},Ps={en:{coder:["You are a Coder. Turn clearly scoped tasks into the smallest correct code change.","Working style:","- Read the relevant files and local patterns before editing.","- Prefer small changes; avoid unrelated refactors and scope creep.","- Run validation that covers the risk. If you cannot validate, explain why.","Report changed files, verification, remaining risk, and blockers."].join(`
|
|
56
|
-
`),custom:["You are a custom team member. Rewrite this into the member's operating contract.","Recommended shape:","- Goal: what this member owns.","- Boundaries: what to do and what to avoid.","- Working style: how to inspect, edit, verify, or review.","- Done means: what results, risks, and blockers to report."].join(`
|
|
57
|
-
`),reviewer:["You are a Reviewer. Focus on quality review; do not replace the Orchestrator or edit by default.","Working style:","- Prioritize real bugs, regressions, edge cases, and test gaps.","- For each issue, include severity, file/line, trigger condition, and minimal fix.","- If no high-risk issue exists, state residual risk and unverified scope.","Report blocking issues first, ordered by severity."].join(`
|
|
58
|
-
`),sentinel:["You are a Sentinel: a read-only patrol observer. You never execute tasks or modify anything.","Working style:","- The runtime periodically injects a workspace snapshot (worker states, open dispatches, possible orphans).","- Cross-check it against your own observations; surface only what deserves a human glance.","- A long-quiet dispatch is not necessarily stuck — big tasks are slow by nature.","Hard boundaries:","- Observe only: no file edits, no side-effecting commands, no dispatching.",'- You take no dispatches and have no `team report`; report findings via `team status "<finding>"`.',"- When nothing is unusual, stay quiet."].join(`
|
|
59
|
-
`),tester:["You are a Tester. Reproduce, test, and produce concrete verification evidence.","Working style:","- Clarify the behavior, entry point, and failure condition under test.","- Prefer real commands or real paths. Add a minimal test when useful.","- Record commands, results, key output, and uncovered scenarios.","Report pass/fail/unverified separately, then suggest the next step."].join(`
|
|
60
|
-
`)},zh:{coder:["你是实现型 Coder,负责把明确任务落成最小正确代码改动。","工作方式:","- 先阅读相关文件和现有模式,再动手。","- 优先小步修改,避免无关重构和范围扩张。","- 改动后运行能覆盖风险的验证命令;不能验证时说明原因。","交付说明要包含:改动文件、验证结果、剩余风险或阻塞。"].join(`
|
|
61
|
-
`),custom:["你是自定义成员。请把这段改成该成员的行为契约。","建议包含:","- 目标:这个成员主要负责什么。","- 边界:哪些事可以做,哪些事不要做。","- 工作方式:如何调查、修改、验证或审查。","- 完成标准:交付时需要说明哪些结果、风险和阻塞。"].join(`
|
|
62
|
-
`),reviewer:["你是监工型 Reviewer,负责质量审查,不替代 Orchestrator,也不默认改代码。","工作方式:","- 优先找真实 bug、回归风险、边界条件和测试缺口。","- 发现问题时给出严重度、文件/行号、触发条件和最小修复建议。","- 没有高风险问题时明确说清剩余风险和未验证范围。","交付说明按严重度排序,先列 blocking 问题。"].join(`
|
|
63
|
-
`),sentinel:["你是只读巡检型 Sentinel,负责观察团队运行状态,不执行任务、不修改任何东西。","工作方式:","- 系统会定期向你注入工作区快照(成员状态、未关闭派单、疑似孤儿单)。",'- 把快照与你自己的观察对照,只把"值得人看一眼"的事项报上去。',"- 长时间无汇报不等于卡死——正常的大任务本来就慢。","硬性边界:","- 只观察:不改文件、不跑有副作用的命令、不派活。",'- 你不接派单,也没有 `team report`;发现统一用 `team status "<巡检发现>"` 汇报。',"- 没有异常时保持安静。"].join(`
|
|
64
|
-
`),tester:["你是验证型 Tester,负责复现、测试和证据化验证。","工作方式:","- 先明确要验证的行为、入口和失败条件。","- 优先跑真实命令或真实链路;必要时补充最小测试。","- 记录命令、结果、关键输出和不能覆盖的场景。","交付说明要区分通过、失败、未验证和建议下一步。"].join(`
|
|
65
|
-
`)}},Tf=(t,a,o)=>t==="custom"?a.find(i=>i.roleType==="custom"&&i.isBuiltin)?.description??Ps[o].custom:Ps[o][t],UA=({createWorker:t,open:a,workers:o})=>{const{language:i}=Se(),[l,u]=y.useState(""),[f,p]=y.useState("coder"),[g,m]=y.useState([]),[b,v]=y.useState(null),[k,S]=y.useState(!1),[E,w]=y.useState(null),[C,T]=y.useState(Ps[i].coder),[N,A]=y.useState([]),[j,O]=y.useState("claude"),[D,L]=y.useState(""),[q,$]=y.useState(null),[ae,G]=y.useState(!1),W=y.useRef(!1),ee=y.useRef(!1),Q=y.useRef(!1),V=Tf(f,g,i),M=y.useMemo(()=>g.filter(ce=>!ce.isBuiltin),[g]);y.useEffect(()=>{if(!a)return;let ce=!1;return rN().then(de=>{ce||(A(de),O(Te=>de.some(xe=>xe.id===Te&&xe.available)?Te:de.find(xe=>xe.id==="claude"&&xe.available)?.id??de.find(xe=>xe.available)?.id??de[0]?.id??""))}).catch(de=>{ce||$(de instanceof Error?de.message:String(de))}),()=>{ce=!0}},[a]),y.useEffect(()=>{if(!a)return;let ce=!1;return lN().then(de=>{ce||m(de)}).catch(de=>{ce||$(de instanceof Error?de.message:String(de))}),()=>{ce=!0}},[a]),y.useEffect(()=>{b===null&&(ee.current||T(Tf(f,g,i)))},[i,g,f,b]);const P=ce=>{ee.current=!0,T(ce)},I=ce=>{W.current=!1,u(ce)},Z=y.useMemo(()=>new Set(o.map(ce=>ce.name)),[o]),F=y.useRef(Z);F.current=Z;const R=()=>{W.current=!0,u(Cf({language:i,role:f,usedNames:Z}))};y.useEffect(()=>{const ce=a&&!Q.current;if(Q.current=a,!!a){if(ce){W.current=!0,u(Cf({language:i,role:f,usedNames:F.current}));return}W.current&&u(Cf({language:i,role:f,usedNames:F.current}))}},[a,i,f]);const B=ce=>{p(ce),v(null),ee.current=!1,T(Tf(ce,g,i))};return{commandPresets:N,commandPresetId:j,createWorkerError:q,creating:ae,customTemplates:M,roleDescription:C,roleDescriptionDefault:V,selectedTemplateId:b,startupCommand:D,templateBusy:k,templateError:E,workerName:l,workerRole:f,setCommandPresetId:ce=>{O(ce)},setRoleDescription:P,setStartupCommand:L,setWorkerName:I,setWorkerRole:B,selectTemplate:ce=>{if(ce===null){p("custom"),v(null),ee.current=!1,T(Ps[i].custom);return}const de=g.find(Te=>Te.id===ce);!de||de.isBuiltin||(p("custom"),v(ce),ee.current=!1,T(de.description))},saveAsTemplate:async ce=>{const de=ce.trim(),Te=C.trim();if(!(!de||!Te)){S(!0),w(null);try{const xe=await cN({name:de,roleType:"custom",description:Te});m(qe=>[...qe,xe]),v(xe.id),p("custom"),ee.current=!1,T(xe.description)}catch(xe){throw w(xe instanceof Error?xe.message:String(xe)),xe}finally{S(!1)}}},deleteTemplate:async ce=>{const de=g.find(Te=>Te.id===ce);if(!(!de||de.isBuiltin)){S(!0),w(null);try{await uN(ce),m(Te=>Te.filter(xe=>xe.id!==ce)),b===ce&&(v(null),ee.current=!1,T(Ps[i].custom))}catch(Te){throw w(Te instanceof Error?Te.message:String(Te)),Te}finally{S(!1)}}},randomizeWorkerName:R,resetRoleDescription:()=>{ee.current=!1,T(V)},resetError:()=>$(null),applyMarketplaceImport:({name:ce,description:de})=>{W.current=!1,u(ce),v(null),p("custom"),ee.current=!0,T(de)},submit:(ce,de)=>{ce.preventDefault(),G(!0),$(null),t({commandPresetId:j,name:l,role:f,roleDescription:C,startupCommand:D}).then(({error:Te})=>{u(""),W.current=!1,B("coder"),v(null),O("claude"),L(""),de(),Te&&$(Te)}).catch(Te=>{$(Te instanceof Error?Te.message:String(Te))}).finally(()=>G(!1))}}},WA=[{icon:c.jsx(Qb,{size:16}),titleKey:"welcome.step1Title",descriptionKey:"welcome.step1Desc"},{icon:c.jsx(wc,{size:16}),titleKey:"welcome.step2Title",descriptionKey:"welcome.step2Desc"},{icon:c.jsx(TE,{size:16}),titleKey:"welcome.step3Title",descriptionKey:"welcome.step3Desc"}],IA=({onAddWorkspace:t,onTryDemo:a,heroImageSrc:o,disabledReason:i})=>{const{t:l}=Se(),u=!!i;return c.jsxs("div",{"data-testid":"welcome-pane",className:"m-auto flex w-full flex-col items-center gap-6 px-6 py-12 text-center",style:{maxWidth:"540px"},children:[o?c.jsx("img",{src:o,alt:"",className:"h-24 w-24","aria-hidden":!0}):null,c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"text-2xl font-semibold text-pri",children:l("welcome.title")}),c.jsx("div",{className:"text-sm text-sec",children:l("welcome.desc")})]}),c.jsx("ol",{className:"grid w-full grid-cols-1 gap-3 text-left md:grid-cols-3",children:WA.map((f,p)=>c.jsxs("li",{className:"rounded border bg-1 p-3",style:{borderColor:"var(--border)"},children:[c.jsxs("div",{className:"mb-1 flex items-center gap-2 text-pri",children:[c.jsx("span",{className:"font-medium text-xs text-ter",children:p+1}),f.icon]}),c.jsx("div",{className:"text-xs font-medium text-pri",children:l(f.titleKey)}),c.jsx("div",{className:"mt-1 text-xs text-ter",children:l(f.descriptionKey)})]},f.titleKey))}),u?c.jsxs("div",{role:"alert","data-testid":"welcome-pane-disabled-reason",className:"flex items-start gap-2 rounded px-3 py-2 text-left text-xs",style:{background:"color-mix(in oklab, var(--status-red) 10%, transparent)",border:"1px solid color-mix(in oklab, var(--status-red) 28%, transparent)",color:"var(--status-red)"},children:[c.jsx($s,{size:14,className:"mt-0.5 shrink-0","aria-hidden":!0}),c.jsx("span",{className:"break-words",children:i})]}):null,c.jsxs("button",{type:"button",disabled:u,onClick:u?void 0:t,"aria-disabled":u||void 0,title:i,className:"icon-btn icon-btn--primary inline-flex items-center gap-2 disabled:cursor-not-allowed disabled:opacity-50","data-testid":"welcome-pane-add",children:[c.jsx("span",{children:l("welcome.addWorkspace")}),c.jsx(vS,{size:14,"aria-hidden":!0})]}),a?c.jsx("button",{type:"button",onClick:a,className:"text-xs text-sec underline hover:text-pri",children:l("welcome.demo")}):null]})},Nf=t=>t==="danger"?"var(--status-red)":"var(--accent)",ci=({open:t,onOpenChange:a,title:o,description:i,confirmLabel:l,confirmKind:u="default",cancelLabel:f,onConfirm:p})=>{const{t:g}=Se(),m=f??g("common.cancel");return c.jsx(Oo,{open:t,onOpenChange:a,children:c.jsxs(Do,{children:[c.jsx(Mo,{"data-testid":"confirm-overlay",className:"app-overlay fixed inset-0 z-[60]"}),c.jsx("div",{className:"pointer-events-none fixed inset-0 z-[70] grid place-items-center p-4",children:c.jsxs(Lo,{"data-testid":"confirm-content",className:"dialog-scale-pop elev-2 pointer-events-auto w-[440px] max-w-[calc(100vw-32px)] rounded-lg border p-5",style:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},children:[c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("div",{"aria-hidden":!0,className:"flex h-9 w-9 shrink-0 items-center justify-center rounded",style:{background:`color-mix(in oklab, ${Nf(u)} 14%, transparent)`,color:Nf(u),border:`1px solid color-mix(in oklab, ${Nf(u)} 30%, transparent)`},children:u==="danger"?c.jsx($s,{size:18}):c.jsx(zS,{size:18})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx(zo,{"data-testid":"confirm-title",className:"text-lg font-semibold text-pri",children:o}),c.jsx(oi,{"data-testid":"confirm-description",className:"mt-1.5 text-sm text-sec",children:i})]})]}),c.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[c.jsx("button",{type:"button","data-testid":"confirm-cancel",onClick:()=>a(!1),autoFocus:u==="danger",className:"icon-btn",children:m}),c.jsx("button",{type:"button","data-testid":"confirm-action",onClick:()=>{p(),a(!1)},autoFocus:u!=="danger",className:u==="danger"?"icon-btn icon-btn--danger-solid":"icon-btn icon-btn--primary",children:l})]})]})})]})})},qA=["You are a Researcher. Collect facts, data, and sources for the assigned topic.","How to work:","- Break the topic into key questions first, then investigate each one.","- Prefer primary sources and real project files; attach a source or file path to every conclusion.","- Separate facts, inferences, and unknowns; never present guesses as facts.","Delivery: include findings by topic, source list, and unresolved questions."].join(`
|
|
66
|
-
`),PA=["你是 Researcher,负责为指定主题收集事实、数据和来源。","工作方式:","- 先拆出要回答的关键问题,再逐项调查。","- 优先一手来源和项目内真实文件;每个结论都附上来源或文件路径。","- 区分事实、推断和未知,不把猜测写成结论。","交付说明:按主题列出发现、来源清单和未解决问题。"].join(`
|
|
67
|
-
`),FA=["You are a Fact-checker. Verify research claims and evidence strength without expanding the scope by default.","How to work:","- Check every claim against its source and mark supported, uncertain, or unsupported.","- Cross-check critical claims with a second source, command, or direct file read.","- When a claim is wrong, provide the corrected wording and evidence.","Delivery: group by confidence and list refuted or uncertain claims first."].join(`
|
|
68
|
-
`),KA=["你是 Fact-checker,负责验证研究结论和证据强度,默认不扩范围。","工作方式:","- 逐条核对结论与其来源,标注支持、存疑或不支持。","- 对关键结论用第二来源、命令或直接读文件做交叉验证。","- 发现错误时给出纠正后的表述和依据。","交付说明:按可信度分组,先列被推翻或存疑的结论。"].join(`
|
|
69
|
-
`),YA=["You are a Drafter. Turn goals and source material into a clear first-draft document.","How to work:","- Confirm audience, purpose, and scope before outlining and writing.","- Use real project code and files as the source of truth; do not invent behavior or APIs.","- Mark missing material and points that need confirmation.","Delivery: include document path, structure overview, and confirmation checklist."].join(`
|
|
70
|
-
`),$A=["你是 Drafter,负责把目标和素材写成清晰的第一版文档。","工作方式:","- 先确认读者、目的和范围,再列提纲,后成文。","- 以项目内真实代码和文件为准,不编造行为或接口。","- 标注待确认和缺素材的位置。","交付说明:包含文档路径、结构概览和确认清单。"].join(`
|
|
71
|
-
`),VA=["You are a Document Reviewer. Check a draft for accuracy and readability; do not rewrite the whole document by default.","How to work:","- Verify technical details against real code and files first.","- Check structure, terminology consistency, and whether readers can follow the document.","- List issues by severity with concrete edits or rewrite examples.","Delivery: list factual errors first, then structure and wording issues."].join(`
|
|
72
|
-
`),GA=["你是 Document Reviewer,负责检查草稿的准确性和可读性;默认不要整篇重写。","工作方式:","- 先对照项目真实代码和文件核对技术细节。","- 检查结构、术语一致性,以及读者能否按文档完成操作。","- 问题按严重度列出,给出具体修改建议或改写示例。","交付说明:先列事实错误,再列结构和表达问题。"].join(`
|
|
73
|
-
`),XA=[{id:"build_review_test",workers:[{nameStem:"coder",role:"coder"},{nameStem:"reviewer",role:"reviewer"},{nameStem:"tester",role:"tester"}],goalTemplate:{en:"Implement <feature>: have the Coder implement, Reviewer audit, and Tester verify; describe what to build, key constraints, and validation commands or acceptance criteria.",zh:"实现 X 功能:让 Coder 实现、Reviewer 审查、Tester 验证;写清楚要做什么、关键约束,以及验证命令或验收标准。"}},{id:"research_factcheck",workers:[{nameStem:"researcher",role:"custom",descriptionOverride:{en:qA,zh:PA}},{nameStem:"factchecker",role:"custom",descriptionOverride:{en:FA,zh:KA}}],goalTemplate:{en:"Research <topic>: have the Researcher gather evidence and the Factchecker verify it; list questions, trusted sources, and the decision this research should support.",zh:"调研 X 主题:让 Researcher 收集证据、Factchecker 复核;列出要回答的问题、可信来源要求,以及这次调研要支撑的决策。"}},{id:"docs_pipeline",workers:[{nameStem:"drafter",role:"custom",descriptionOverride:{en:YA,zh:$A}},{nameStem:"doc-reviewer",role:"custom",descriptionOverride:{en:VA,zh:GA}}],goalTemplate:{en:"Write <doc>: have the Drafter write and the Doc Reviewer review; state the audience, scope, required sections, and code or files it should describe.",zh:"撰写 X 文档:让 Drafter 撰写、Doc Reviewer 审查;写明读者、范围、必备章节,以及它要描述的代码或文件。"}}],Yy={build_review_test:{icon:c.jsx(nE,{size:16,"aria-hidden":!0}),titleKey:"scenario.build_review_test.title",descKey:"scenario.build_review_test.desc"},research_factcheck:{icon:c.jsx(wS,{size:16,"aria-hidden":!0}),titleKey:"scenario.research_factcheck.title",descKey:"scenario.research_factcheck.desc"},docs_pipeline:{icon:c.jsx(Zb,{size:16,"aria-hidden":!0}),titleKey:"scenario.docs_pipeline.title",descKey:"scenario.docs_pipeline.desc"}},ZA=({workspaceId:t})=>{const{language:a,t:o}=Se(),i=tn(),[l,u]=y.useState(null),[f,p]=y.useState(""),[g,m]=y.useState(!1),b=S=>{p(S.goalTemplate[a]),u(S)},v=()=>{g||u(null)},k=()=>{!l||g||!f.trim()||(m(!0),mN(t,l.id,f,a).then(()=>{i.show({kind:"success",message:o("scenario.applied")}),u(null)}).catch(S=>{i.show({kind:"error",message:S instanceof Error?S.message:String(S)})}).finally(()=>m(!1)))};return c.jsxs("div",{className:"mx-auto mt-6 w-full max-w-[420px]","data-testid":"scenario-team-cards",children:[c.jsxs("div",{className:"mb-2 flex items-center justify-center gap-1.5 text-xs font-medium uppercase tracking-wide text-ter",children:[c.jsx(a0,{size:12,"aria-hidden":!0}),o("scenario.sectionTitle")]}),c.jsx("div",{className:"flex flex-col gap-2",children:XA.map(S=>{const E=Yy[S.id];return c.jsxs("button",{type:"button",onClick:()=>b(S),className:"rounded border bg-1 p-3 text-left transition-colors hover:bg-3",style:{borderColor:"var(--border)"},"data-testid":`scenario-card-${S.id}`,children:[c.jsxs("div",{className:"flex items-center gap-2 text-pri",children:[E.icon,c.jsx("span",{className:"text-sm font-medium",children:o(E.titleKey)})]}),c.jsx("div",{className:"mt-1 text-xs text-ter",children:o(E.descKey)})]},S.id)})}),c.jsx(Oo,{open:l!==null,onOpenChange:S=>{S||v()},children:c.jsxs(Do,{children:[c.jsx(Mo,{className:"app-overlay fixed inset-0 z-[60]"}),c.jsx("div",{className:"pointer-events-none fixed inset-0 z-[70] grid place-items-center p-4",children:c.jsxs(Lo,{"data-testid":"scenario-goal-dialog",className:"dialog-scale-pop elev-2 pointer-events-auto w-[480px] max-w-[calc(100vw-32px)] rounded-lg border p-5",style:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},onEscapeKeyDown:S=>{g&&S.preventDefault()},onPointerDownOutside:S=>{g&&S.preventDefault()},children:[c.jsx(zo,{className:"text-lg font-semibold text-pri",children:l?o(Yy[l.id].titleKey):""}),c.jsx(oi,{className:"mt-1 text-xs text-ter",children:o("scenario.goalHint")}),c.jsxs("label",{className:"mt-4 block",children:[c.jsx("span",{className:"mb-1 block text-xs font-medium text-sec",children:o("scenario.goalLabel")}),c.jsx("textarea",{value:f,onChange:S=>p(S.target.value),rows:5,className:"w-full resize-y rounded border bg-1 p-2 text-sm text-pri outline-none focus:border-[var(--accent)]",style:{borderColor:"var(--border)"},disabled:g,"data-testid":"scenario-goal-input"})]}),c.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[c.jsx("button",{type:"button",className:"icon-btn",onClick:v,disabled:g,"data-testid":"scenario-goal-cancel",children:o("scenario.cancel")}),c.jsx("button",{type:"button",className:"icon-btn icon-btn--primary disabled:cursor-not-allowed disabled:opacity-50",onClick:k,disabled:g||!f.trim(),"data-testid":"scenario-goal-apply",children:o(g?"scenario.applying":"scenario.apply")})]})]})})]})})]})},rx=({size:t,children:a,color:o,fontRatio:i=.4,ringColor:l=null,ringSurface:u="var(--bg-1)",mono:f=!1,decoration:p,testId:g,data:m,className:b="",style:v={}})=>{const k={};if(m)for(const[S,E]of Object.entries(m))E!==void 0&&(k[`data-${S}`]=E);return c.jsxs("span",{"data-testid":g,...k,className:`relative inline-flex shrink-0 items-center justify-center rounded font-semibold ${f?"mono ":""}${b}`.trim(),style:{width:`${t}px`,height:`${t}px`,fontSize:`${Math.round(t*i)}px`,color:o,background:`color-mix(in oklab, ${o} 14%, transparent)`,border:`1px solid color-mix(in oklab, ${o} 35%, transparent)`,boxShadow:l?`0 0 0 2px ${u}, 0 0 0 4px ${l}`:void 0,...v},"aria-hidden":!0,children:[a,p]})},QA={orchestrator:Sm,coder:FS,reviewer:EE,tester:Gl,sentinel:ZS,custom:DE},JA={orchestrator:"crown",coder:"code",reviewer:"review",tester:"test",sentinel:"sentinel",custom:"custom"},eR={orchestrator:"var(--accent)",coder:"var(--status-blue)",reviewer:"var(--status-purple)",tester:"var(--status-orange)",sentinel:"var(--status-green)",custom:"var(--text-secondary)"},tR={working:"var(--status-green)",idle:"var(--text-tertiary)",stopped:"var(--status-red)"},nR=({role:t,size:a=32,statusRing:o="none"})=>{const i=QA[t];return c.jsx(rx,{size:a,color:eR[t],ringColor:o==="none"?null:tR[o],ringSurface:"var(--bg-2)",testId:"role-avatar",data:{role:t,icon:JA[t],"status-ring":o},children:c.jsx(i,{size:Math.round(a*.56),"aria-hidden":!0})})},aR={agy:{src:"/cli-icons/agy.png",surface:"#f4f4f4"},claude:{src:"/cli-icons/claude.png",surface:"#f7f5f2"},codex:{src:"/cli-icons/codex.png",surface:"#f4f4f4"},cursor:{src:"/cli-icons/cursor.ico",surface:"#ffffff"},gemini:{src:"/cli-icons/gemini.png",surface:"#f4f4f4"},grok:{src:"/cli-icons/grok.ico",surface:"#ffffff"},hermes:{src:"/cli-icons/hermes.png",surface:"#ffffff"},opencode:{src:"/cli-icons/opencode.svg",surface:"#f4f4f4"},pi:{src:"/cli-icons/pi.svg",surface:"#1a1a1a"},qwen:{src:"/cli-icons/qwen.png",surface:"#f4f8ff"}},rR={working:"var(--status-green)",idle:"var(--text-tertiary)",stopped:"var(--status-red)"},ox=t=>t?aR[t]??null:null,BM=({commandPresetId:t,fallback:a=null,size:o=20,testId:i="cli-agent-logo"})=>{const l=ox(t);if(!l)return a;const u=Math.round(o*.78);return c.jsx("span",{"data-testid":i,"data-command-preset":t,className:"inline-flex shrink-0 items-center justify-center overflow-hidden rounded","aria-hidden":!0,style:{width:`${o}px`,height:`${o}px`,background:l.surface,border:"1px solid color-mix(in oklab, var(--text-primary) 12%, transparent)"},children:c.jsx("img",{src:l.src,alt:"",decoding:"sync",width:u,height:u,style:{width:`${u}px`,height:`${u}px`,objectFit:"contain"}})})},sx=({commandPresetId:t,workerRole:a,size:o=32,statusRing:i="none"})=>{const l=ox(t);if(!l)return c.jsx(nR,{role:a,size:o,statusRing:i});const u=i==="none"?null:rR[i],f=Math.round(o*.78);return c.jsx("span",{"data-testid":"cli-agent-avatar","data-command-preset":t,"data-status-ring":i,className:"relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded","aria-hidden":!0,style:{width:`${o}px`,height:`${o}px`,background:l.surface,border:"1px solid color-mix(in oklab, var(--text-primary) 12%, transparent)",boxShadow:u?`0 0 0 2px var(--bg-1), 0 0 0 4px ${u}`:void 0},children:c.jsx("img",{src:l.src,alt:"",decoding:"sync",width:f,height:f,style:{width:`${f}px`,height:`${f}px`,objectFit:"contain"}})})},ix=({initialValue:t,saving:a,setSaving:o,onSave:i,onCancel:l,className:u})=>{const f=tn(),[p,g]=y.useState(t),m=y.useRef(null),b=y.useRef(!1);y.useEffect(()=>{const E=setTimeout(()=>{m.current?.focus(),m.current?.select()},50);return()=>clearTimeout(E)},[]);const v=async()=>{const E=p.trim();if(!E||E===t){l();return}o(!0);try{const w=await i(E);if(w.error){f.show({kind:"error",message:w.error}),g(t),setTimeout(()=>{m.current?.focus(),m.current?.select()},50),o(!1);return}}catch(w){const C=w instanceof Error?w.message:"Failed to rename worker";f.show({kind:"error",message:C}),g(t),setTimeout(()=>{m.current?.focus(),m.current?.select()},50),o(!1);return}o(!1),l()},k=E=>{E.stopPropagation(),E.key==="Enter"?(E.preventDefault(),v()):E.key==="Escape"&&(E.preventDefault(),b.current=!0,l())},S=()=>{b.current||v()};return c.jsx("input",{ref:m,type:"text",value:p,disabled:a,onChange:E=>g(E.target.value),onKeyDown:k,onBlur:S,maxLength:64,className:u,onClick:E=>E.stopPropagation()})},lx=t=>t.status==="working"?{kind:"working",label:"working",dotClass:"status-dot status-dot--working",tone:"var(--status-green)"}:t.status==="stopped"?{kind:"stopped",label:"stopped",dotClass:"status-dot status-dot--stopped",tone:"var(--status-red)"}:{kind:"idle",label:"idle",dotClass:"status-dot status-dot--idle",tone:"var(--text-tertiary)"},UM=t=>t?{kind:"working",label:"running",dotClass:"status-dot status-dot--working",tone:"var(--status-green)"}:{kind:"stopped",label:"stopped",dotClass:"status-dot status-dot--stopped",tone:"var(--status-red)"},cx={working:"pill--green",idle:"pill--ghost",stopped:"pill--red"},ux=t=>`role.${t}`,ic=t=>t==="working"?"common.running":t==="idle"?"common.idle":"common.stopped",oR=({hasRun:t,isPending:a=!1,isEditing:o=!1,onRenameWorker:i,onStartEditing:l,onCancelEditing:u,onAction:f,onClick:p,worker:g})=>{const{t:m}=Se(),b=xt(),v=lx(g),[k,S]=y.useState(!1),E=A=>j=>{if(j.stopPropagation(),A==="rename"){l?.();return}f?.(A,g)},w=g.ephemeral===!0&&g.spawnedBy==="workflow",C=g.ephemeral===!0&&g.spawnedBy==="orchestrator",T=w?"workflow":C?"orchestrator":null;if(b)return c.jsx(sR,{ephemeralTone:T,hasRun:t,isPending:a,onAction:f,onClick:p,status:v,worker:g,isEditing:o,onRenameWorker:i,onCancelEditing:u});const N=o?"div":"button";return c.jsxs("div",{className:"worker-card-shell relative","data-status":v.kind,"data-worker-name":g.name,"data-ephemeral":g.ephemeral===!0?"true":void 0,"data-spawned-by":g.spawnedBy??void 0,"data-mobile":b?"true":void 0,children:[c.jsxs(N,{type:o?void 0:"button",onClick:o?void 0:()=>p(g),"aria-label":o?void 0:m("worker.open",{name:g.name}),className:`card worker-card relative flex w-full flex-col gap-3 overflow-hidden p-4 text-left ${o?"":"card--interactive"}`,"data-testid":`worker-card-${g.id}`,"data-status":v.kind,style:T?{borderStyle:"dashed",borderColor:T==="workflow"?"var(--accent)":"var(--border-bright)"}:void 0,children:[c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(sx,{commandPresetId:g.commandPresetId,workerRole:g.role,size:40,statusRing:v.kind}),T?c.jsx("span",{className:"ml-auto rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide",style:{background:T==="workflow"?"color-mix(in oklab, var(--accent) 18%, transparent)":"color-mix(in oklab, var(--text-secondary) 14%, transparent)",color:T==="workflow"?"var(--accent)":"var(--text-secondary)"},"data-testid":"worker-card-ephemeral-badge",title:T==="workflow"?"Spawned by a workflow run — auto-dismissed when its dispatch reports back.":"Spawned by the orchestrator via `team spawn` — auto-dismissed when the orchestrator exits.",children:T==="workflow"?"workflow":"temp"}):null]}),c.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[o?c.jsx(ix,{initialValue:g.name,saving:k,setSaving:S,onSave:A=>i(g,A),onCancel:()=>u?.(),className:"worker-card-name-input"}):c.jsx("span",{className:"truncate text-base font-medium leading-tight text-pri",title:g.name,children:g.name}),c.jsx("span",{className:"worker-card__role-tag truncate leading-none mt-1",children:m(ux(g.role))})]}),c.jsx("div",{className:"flex min-w-0 flex-col gap-1.5",children:c.jsx("div",{className:"flex items-center gap-1.5",children:c.jsxs("span",{className:`pill ${cx[v.kind]} worker-card__status`,role:"status",title:v.kind==="working"?m("worker.workingLegend"):m(ic(v.kind)),children:[c.jsx("span",{className:v.dotClass,"aria-hidden":!0}),m(ic(v.kind))]})})})]}),f?c.jsxs("div",{className:"worker-card__actions",children:[t?b?c.jsxs(c.Fragment,{children:[c.jsx(Ms,{title:m("common.stop"),onClick:E("stop"),disabled:a,variant:"danger",testId:`worker-card-stop-${g.id}`,ariaLabel:m("worker.stopAria",{name:g.name}),children:c.jsx(r0,{size:12,"aria-hidden":!0})}),c.jsx(Ms,{title:m("common.restart"),onClick:E("restart"),disabled:a,testId:`worker-card-restart-${g.id}`,ariaLabel:m("worker.restartAria",{name:g.name}),children:c.jsx(Tm,{size:12,"aria-hidden":!0})})]}):null:c.jsx(Ms,{title:m("common.start"),onClick:E("start"),disabled:a,variant:"primary",testId:`worker-card-start-${g.id}`,ariaLabel:m("worker.startAria",{name:g.name}),children:c.jsx(Ao,{size:12,"aria-hidden":!0})}),c.jsx(Ms,{title:m("worker.rename"),onClick:E("rename"),disabled:a||v.kind==="working",testId:`worker-card-rename-${g.id}`,ariaLabel:m("worker.renameAria",{name:g.name}),children:c.jsx(t0,{size:12,"aria-hidden":!0})}),c.jsx(Ms,{title:m("common.delete"),onClick:E("delete"),variant:"danger",testId:`worker-card-delete-${g.id}`,ariaLabel:m("worker.deleteAria",{name:g.name}),children:c.jsx(bc,{size:12,"aria-hidden":!0})})]}):null]})},Ms=({ariaLabel:t,children:a,disabled:o,onClick:i,testId:l,title:u,variant:f="default"})=>c.jsx(et,{label:u,children:c.jsx("button",{type:"button",onClick:i,disabled:o,"aria-label":t,"data-testid":l,"data-variant":f,className:"worker-card__action",children:a})}),sR=({ephemeralTone:t,hasRun:a,isPending:o,onAction:i,onClick:l,status:u,worker:f,isEditing:p=!1,onRenameWorker:g,onCancelEditing:m})=>{const{t:b}=Se(),[v,k]=y.useState(!1),[S,E]=y.useState(!1),w=y.useRef(!1),C=A=>{A==="rename"&&(w.current=!0),k(!1),i?.(A,f)},T=b(ux(f.role)),N=p?"div":"button";return c.jsxs("div",{className:"worker-card-shell relative","data-status":u.kind,"data-worker-name":f.name,"data-ephemeral":f.ephemeral===!0?"true":void 0,"data-spawned-by":f.spawnedBy??void 0,"data-mobile":"true",children:[c.jsxs(N,{type:p?void 0:"button",onClick:p?void 0:()=>l(f),"aria-label":p?void 0:b("worker.open",{name:f.name}),className:`card worker-card flex w-full items-center gap-3 p-3 pr-12 text-left ${p?"":"card--interactive"}`,"data-testid":`worker-card-${f.id}`,"data-status":u.kind,style:t?{borderStyle:"dashed",borderColor:t==="workflow"?"var(--accent)":"var(--border-bright)"}:void 0,children:[c.jsx(sx,{commandPresetId:f.commandPresetId,workerRole:f.role,size:40,statusRing:u.kind}),c.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[c.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[p?c.jsx(ix,{initialValue:f.name,saving:S,setSaving:E,onSave:A=>g(f,A),onCancel:()=>m?.(),className:"worker-card-name-input flex-1"}):c.jsx("span",{className:"truncate text-sm font-medium text-pri",children:f.name}),t?c.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide",style:{background:t==="workflow"?"color-mix(in oklab, var(--accent) 18%, transparent)":"color-mix(in oklab, var(--text-secondary) 14%, transparent)",color:t==="workflow"?"var(--accent)":"var(--text-secondary)"},"data-testid":"worker-card-ephemeral-badge",children:t==="workflow"?"workflow":"temp"}):null]}),c.jsx("span",{className:"truncate text-xs text-ter",children:T})]}),c.jsxs("span",{className:`pill ${cx[u.kind]} worker-card__status shrink-0`,role:"status",children:[c.jsx("span",{className:u.dotClass,"aria-hidden":!0}),b(ic(u.kind))]})]}),i?c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button","aria-label":b("worker.actionsAria",{name:f.name}),"data-testid":`worker-card-menu-${f.id}`,onClick:()=>k(!0),className:"absolute top-1/2 right-1 z-[2] flex h-11 w-11 -translate-y-1/2 items-center justify-center rounded-md text-ter",children:c.jsx(VS,{size:18,"aria-hidden":!0})}),c.jsx(Oo,{open:v,onOpenChange:k,children:c.jsxs(Do,{children:[c.jsx(Mo,{className:"app-overlay fixed inset-0 z-40"}),c.jsx("div",{className:"pointer-events-none fixed inset-0 z-50 grid items-end",children:c.jsxs(Lo,{onCloseAutoFocus:A=>{w.current&&(A.preventDefault(),w.current=!1)},"data-testid":`worker-action-sheet-${f.id}`,className:"dialog-slide-up elev-2 pointer-events-auto flex w-full flex-col overflow-hidden rounded-t-xl border-t pb-[max(8px,env(safe-area-inset-bottom))]",style:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},children:[c.jsxs(zo,{className:"flex items-center gap-2 border-b px-4 py-3 text-sm font-semibold text-pri",style:{borderColor:"var(--border)"},children:[c.jsx("span",{className:"truncate",children:f.name}),c.jsx("span",{className:"shrink-0 text-xs font-normal text-ter",children:b(ic(u.kind))})]}),c.jsx(oi,{className:"sr-only",children:b("worker.actionsAria",{name:f.name})}),a?c.jsxs(c.Fragment,{children:[c.jsx(Ls,{disabled:o,icon:c.jsx(r0,{size:16,"aria-hidden":!0}),label:b("common.stop"),onSelect:()=>C("stop"),testId:`worker-card-stop-${f.id}`,danger:!0}),c.jsx(Ls,{disabled:o,icon:c.jsx(Tm,{size:16,"aria-hidden":!0}),label:b("common.restart"),onSelect:()=>C("restart"),testId:`worker-card-restart-${f.id}`})]}):c.jsx(Ls,{disabled:o,icon:c.jsx(Ao,{size:16,"aria-hidden":!0}),label:b("common.start"),onSelect:()=>C("start"),testId:`worker-card-start-${f.id}`}),c.jsx(Ls,{disabled:o||u.kind==="working",icon:c.jsx(t0,{size:16,"aria-hidden":!0}),label:b("worker.rename"),onSelect:()=>C("rename"),testId:`worker-card-rename-${f.id}`}),c.jsx(Ls,{icon:c.jsx(bc,{size:16,"aria-hidden":!0}),label:b("common.delete"),onSelect:()=>C("delete"),testId:`worker-card-delete-${f.id}`,danger:!0})]})})]})})]}):null]})},Ls=({danger:t=!1,disabled:a=!1,icon:o,label:i,onSelect:l,testId:u})=>c.jsxs("button",{type:"button",disabled:a,"data-testid":u,onClick:l,className:"flex min-h-12 w-full items-center gap-3 px-4 text-left text-sm disabled:opacity-50",style:{color:t?"var(--status-red)":"var(--text-primary)"},children:[o,i]}),iR=["working","idle","stopped"],$y=t=>t==="working"?"common.running":t==="idle"?"common.idle":"common.stopped",lR=t=>{const a={idle:[],working:[],stopped:[]};for(const o of t)a[lx(o).kind].push(o);return{sections:iR.filter(o=>a[o].length>0).map(o=>({kind:o,workers:a[o]})),summary:{idle:a.idle.length,stopped:a.stopped.length,working:a.working.length}}},cR=({onAddWorkerClick:t,onDeleteWorker:a,onOpenShellTerminal:o,onOpenWorker:i,onRenameWorker:l,onStopWorker:u,onRestartWorker:f,onStartWorker:p,shellTerminalAvailable:g=!0,startingWorkerId:m,terminalRuns:b,workers:v,workspaceId:k})=>{const{t:S}=Se(),{sections:E,summary:w}=y.useMemo(()=>lR(v),[v]),C=y.useMemo(()=>new Map(b.map(L=>[L.agent_id,L.run_id])),[b]),[T,N]=y.useState(null),[A,j]=y.useState(null),O=(L,q)=>{if(L==="start"){p(q);return}if(L==="stop"){const $=C.get(q.id);$&&u?.($);return}if(L==="restart"){const $=C.get(q.id);$&&f?.(q.id,$);return}if(L==="rename"){j(q.id);return}L==="delete"&&N(q)},D=()=>{T&&(a(T),N(null))};return c.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",style:{background:"var(--bg-2)"},"data-testid":"workers-pane",children:[c.jsxs("div",{className:"flex shrink-0 flex-col gap-1 px-4 pt-3 pb-2.5",style:{boxShadow:"inset 0 -1px 0 var(--border)"},children:[c.jsxs("div",{className:"flex items-center gap-2.5",children:[c.jsx("span",{className:"text-lg font-semibold text-pri",children:S("worker.teamMembers")}),c.jsx("span",{className:"mono inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-3 px-1 text-[11px] font-medium tabular-nums leading-none text-sec",children:v.length}),c.jsx("div",{className:"flex-1"}),g?c.jsxs("button",{type:"button",onClick:o,className:"icon-btn icon-btn--tertiary","aria-label":S("shellTerminal.openAria"),"data-testid":"open-workspace-shell",children:[c.jsx(yc,{size:14,"aria-hidden":!0})," ",S("shellTerminal.open")]}):null,c.jsxs("button",{type:"button",onClick:t,className:"icon-btn icon-btn--primary","data-testid":"add-worker-trigger",children:[c.jsx(af,{size:14,"aria-hidden":!0})," ",S("addWorker.create")]})]}),v.length>0?c.jsxs("div",{className:"flex items-center gap-3 text-xs text-ter",children:[c.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[c.jsx("span",{className:"status-dot status-dot--working","aria-hidden":!0}),c.jsx("span",{className:"text-sec",children:w.working})," ",S("common.running")]}),c.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[c.jsx("span",{className:"status-dot status-dot--idle","aria-hidden":!0}),c.jsx("span",{className:"text-sec",children:w.idle})," ",S("common.idle")]}),c.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[c.jsx("span",{className:"status-dot status-dot--stopped","aria-hidden":!0}),c.jsx("span",{className:"text-sec",children:w.stopped})," ",S("common.stopped")]})]}):null]}),c.jsx("div",{className:"workers-pane-body scroll-y min-h-0 min-w-0 flex-1 px-2 py-2",children:v.length===0?c.jsxs(c.Fragment,{children:[c.jsx(li,{icon:c.jsx(af,{size:28}),title:S("worker.emptyTitle"),description:S("worker.emptyDesc"),action:c.jsxs("button",{type:"button",onClick:t,className:"icon-btn icon-btn--primary","data-testid":"add-worker-empty",children:[c.jsx(af,{size:14,"aria-hidden":!0})," ",S("worker.emptyAdd")]})}),k?c.jsx(ZA,{workspaceId:k}):null]}):c.jsx("div",{"data-testid":"worker-grid",children:E.map(L=>c.jsxs("section",{className:"mb-3 last:mb-0",children:[c.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 text-xs font-medium uppercase tracking-wide text-ter",children:[S($y(L.kind)),c.jsx("span",{className:"mono inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-full px-1 text-[11px] font-medium tabular-nums leading-none",children:L.workers.length})]}),c.jsx("ul",{"aria-label":`${S($y(L.kind))} team members`,className:"worker-card-grid",children:L.workers.map(q=>c.jsx("li",{children:c.jsx(oR,{hasRun:C.has(q.id),isPending:m===q.id||q.status!=="stopped"&&!C.has(q.id),isEditing:A===q.id,onRenameWorker:async($,ae)=>v.some(W=>W.id!==$.id&&W.name.toLowerCase()===ae.toLowerCase())?{error:S("addWorker.agentExists")}:l($,ae),onStartEditing:()=>j(q.id),onCancelEditing:()=>j(null),onAction:O,onClick:i,worker:q})},q.id))})]},L.kind))})}),c.jsx(ci,{open:T!==null,onOpenChange:L=>{L||N(null)},title:T?S("worker.deleteConfirm",{name:T.name}):"",description:T?S("worker.deleteDescription",{name:T.name}):"",confirmLabel:S("worker.deleteMember"),confirmKind:"danger",onConfirm:D})]})},uR=y.lazy(()=>Nt(()=>import("./AddWorkerDialog-DcEIii34.js"),__vite__mapDeps([2,3,4])).then(t=>({default:t.AddWorkerDialog}))),dR=y.lazy(()=>Nt(()=>import("./WorkerModal-CuB3F-m-.js"),[]).then(t=>({default:t.WorkerModal}))),fR=({activeWorkerId:t,onCreateWorker:a,onDeleteWorker:o,onDeleteWorkspace:i,onStartWorker:l,onStopWorker:u,onRestartWorker:f,onOrchestratorResult:p,onOrchestratorRunClosed:g,onRequestAddWorkspace:m,onShellRunClosed:b,onShellRunStarted:v,onTryDemo:k,welcomeDisabledReason:S,orchestratorAutostartError:E,terminalRuns:w,workers:C,workspace:T,onActiveWorkerChange:N,showInlineActionCenter:A=!0})=>{const{t:j}=Se(),O=xt(),[D,L]=y.useState(null),q=t===void 0?D:t,$=y.useCallback(ke=>{N?N(ke):L(ke)},[N]),[ae,G]=y.useState(!1),[W,ee]=y.useState("orchestrator"),Q=Yw();y.useEffect(()=>()=>Kw(!1),[]);const[V,M]=y.useState(null),[P,I]=y.useState(null),[Z,F]=y.useState(null),[R,B]=y.useState(!1),se=tn(),te=UA({createWorker:a,open:ae,workers:C}),fe=AA({workspaceId:T?.id??"",terminalRuns:w,autostartError:E,onClearAutostartError:()=>{T&&p(T.id,{ok:!0,error:null,run_id:null})},onAfterStart:ke=>{T&&p(T.id,ke)},onRunClosed:g}),me=wA(),ue=C.find(ke=>ke.id===q)??null;y.useEffect(()=>{q&&!ue&&$(null)},[q,ue,$]);const ie=cA({workspaceId:T?.id??"",workers:C,terminalRuns:w}),le=ie.tabs.filter(ke=>ke.kind==="shell"),ce=T?w.filter(ke=>Gs(ke,T.id)):[],{closeShellTab:de,openShell:Te,shellError:xe,shellStarting:qe,startNewShell:Qe}=yA({onCloseFailed:ke=>se.show({kind:"error",message:j("shellTerminal.closeFailed",{message:ke})}),onShellRunClosed:b,onShellRunStarted:v,panelTabs:ie,shellRuns:ce,workspaceId:T?.id??null});if(y.useEffect(()=>{te.createWorkerError&&se.show({kind:"error",message:te.createWorkerError})},[te.createWorkerError,se]),y.useEffect(()=>{V&&se.show({kind:"error",message:V})},[V,se]),y.useEffect(()=>{P&&se.show({kind:"error",message:P})},[P,se]),y.useEffect(()=>{xe&&se.show({kind:"error",message:xe})},[xe,se]),y.useEffect(()=>{$(null),M(null),I(null),F(null),B(!1),ee("orchestrator")},[T?.id,$]),!T){const ke={onAddWorkspace:m};return k&&(ke.onTryDemo=k),S&&(ke.disabledReason=S),c.jsx(IA,{...ke})}const _t=ue?vA(w,ue.id):void 0,nn=ke=>{M(null),o(ke.id).then(()=>$(null)).catch(Re=>{M(Re instanceof Error?Re.message:String(Re))})},an=ke=>{I(null),F(ke.id),l(ke.id).then(({error:Re})=>{Re&&I(Re)}).catch(Re=>{I(Re instanceof Error?Re.message:String(Re))}).finally(()=>F(null))},jn=ke=>{u(ke).then(({error:Re})=>{Re&&se.show({kind:"error",message:Re})})},De=(ke,Re)=>{I(null),F(ke),f(ke,Re).then(({error:ve})=>{ve&&I(ve)}).catch(ve=>{I(ve instanceof Error?ve.message:String(ve))}).finally(()=>F(null))},vn=async(ke,Re)=>{try{return await hN(T.id,ke.id,Re),se.show({kind:"success",message:j("worker.renameSuccess",{name:Re})}),{error:null}}catch(ve){const Oe=ve instanceof Error?ve.message:String(ve);return se.show({kind:"error",message:j("worker.renameFailed",{message:Oe})}),{error:Oe}}},fa=`${(me.orchPct*100).toFixed(2)}%`,ma=()=>{B(!1),Te()},we=()=>{B(!1),Qe()},at=c.jsx(_A,{state:fe.state,onRemoveWorkspace:()=>{i(T).catch(ke=>{const Re=ke instanceof Error?ke.message:String(ke);se.show({kind:"error",message:`Delete failed: ${Re}`})})},onStart:fe.start,onRestart:fe.restart}),In=c.jsxs("div",{className:"relative flex min-h-0 min-w-0 flex-1 flex-col",children:[c.jsx(cR,{onAddWorkerClick:()=>G(!0),onDeleteWorker:nn,onOpenShellTerminal:ma,onOpenWorker:ke=>$(ke.id),onRenameWorker:vn,onStartWorker:an,onStopWorker:jn,onRestartWorker:De,startingWorkerId:Z,terminalRuns:w,workers:C,workspaceId:T.id}),R?null:c.jsx(oA,{tabs:le,activeId:ie.activeId,scopeKey:T.id,onSelect:ie.setActive,onClose:ke=>{ke.startsWith("shell:")&&de(ke.slice(6)),ie.closeTab(ke)},onClosePanel:()=>B(!0),onNewShell:we,newShellPending:qe,onStartWorker:ke=>{const Re=C.find(ve=>ve.id===ke);Re&&an(Re)},startingWorkerId:Z})]});return c.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",style:{background:"var(--bg-2)"},children:[c.jsx(Z_,{terminalRuns:w,workers:C,workspace:T}),A?c.jsx(W_,{workspaceId:T.id,onOpenWorker:$},T.id):null,O?c.jsxs("div",{className:"relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden","data-mobile":"true","data-testid":"workspace-detail-panes",children:[c.jsxs("div",{role:"tablist","aria-label":j("mobile.nav.team"),className:"flex shrink-0 items-center gap-1 border-b p-2",style:{borderColor:"var(--border)"},children:[["orchestrator","workers"].map(ke=>{const Re=W===ke,ve=`mobile-team-tab-${ke}`,Oe=`mobile-team-panel-${ke}`;return c.jsxs("button",{id:ve,type:"button",role:"tab","aria-selected":Re,"aria-controls":Oe,tabIndex:Re?0:-1,"data-active":Re||void 0,"data-testid":ve,onClick:()=>ee(ke),className:"flex min-h-11 flex-1 items-center justify-center gap-1.5 rounded-md text-sm font-medium",style:Re?{background:"var(--accent)",color:"var(--bg-0)"}:{background:"var(--bg-3)",color:"var(--text-secondary)"},children:[c.jsx("span",{children:j(ke==="orchestrator"?"mobile.team.orchestrator":"mobile.team.workers")}),ke==="workers"&&C.length>0?c.jsx("span",{className:"inline-flex items-center justify-center rounded-full min-w-[18px] h-[18px] px-1 text-[11px] font-medium tabular-nums leading-none",style:Re?{background:"var(--bg-0)",color:"var(--accent)"}:{background:"var(--bg-1)",color:"var(--text-secondary)"},children:C.length}):null]},ke)}),c.jsx("button",{type:"button",onClick:q_,"aria-pressed":Q,"aria-label":j(Q?"mobile.focus.exit":"mobile.focus.enter"),"data-testid":"mobile-focus-toggle",className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-md",style:{background:"var(--bg-3)",color:"var(--text-secondary)"},children:Q?c.jsx(pE,{size:16,"aria-hidden":!0}):c.jsx(fE,{size:16,"aria-hidden":!0})})]}),c.jsxs("div",{className:"relative min-h-0 min-w-0 flex-1 overflow-hidden","data-testid":"mobile-team-panel",children:[c.jsx("div",{id:"mobile-team-panel-orchestrator",role:"tabpanel","aria-labelledby":"mobile-team-tab-orchestrator","aria-hidden":W!=="orchestrator",className:"mobile-team-pane flex min-h-0 min-w-0 flex-col","data-active":W==="orchestrator"?"true":"false",children:at}),c.jsx("div",{id:"mobile-team-panel-workers",role:"tabpanel","aria-labelledby":"mobile-team-tab-workers","aria-hidden":W!=="workers",className:"mobile-team-pane flex min-h-0 min-w-0 flex-col","data-active":W==="workers"?"true":"false",children:In})]})]}):c.jsxs("div",{ref:me.containerRef,className:"relative flex min-h-0 min-w-0 flex-1 overflow-hidden","data-testid":"workspace-detail-panes",children:[c.jsx("div",{className:"flex min-w-[480px] shrink-0 flex-col overflow-hidden",style:{width:fa},"data-testid":"orchestrator-pane-shell",children:at}),c.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":j("workerPane.resize"),"aria-valuenow":Math.round(me.orchPct*100),"aria-valuemin":30,"aria-valuemax":78,tabIndex:0,className:"pane-splitter",style:{left:`calc(${fa} - 4px)`},"data-dragging":me.dragging||void 0,"data-testid":"pane-splitter",onPointerDown:me.beginDrag,onKeyDown:me.onKeyDown}),In]}),ue?c.jsx(y.Suspense,{fallback:null,children:c.jsx(dR,{onClose:()=>$(null),onStart:an,runId:_t?.run_id??null,startError:P,starting:Z===ue.id,worker:ue})}):null,ae?c.jsx(y.Suspense,{fallback:null,children:c.jsx(uR,{commandPresets:te.commandPresets,commandPresetId:te.commandPresetId,creating:te.creating,customTemplates:te.customTemplates,onApplyMarketplaceImport:te.applyMarketplaceImport,onClose:()=>G(!1),onDeleteTemplate:te.deleteTemplate,onNameChange:te.setWorkerName,onPresetChange:te.setCommandPresetId,onRandomName:te.randomizeWorkerName,onRoleDescriptionChange:te.setRoleDescription,onRoleDescriptionReset:te.resetRoleDescription,onRoleChange:te.setWorkerRole,onSaveAsTemplate:te.saveAsTemplate,onSubmit:ke=>te.submit(ke,()=>G(!1)),onStartupCommandChange:te.setStartupCommand,onTemplateChange:te.selectTemplate,roleDescription:te.roleDescription,roleDescriptionDefault:te.roleDescriptionDefault,selectedTemplateId:te.selectedTemplateId,startupCommand:te.startupCommand,templateBusy:te.templateBusy,workerName:te.workerName,workerRole:te.workerRole})}):null]})},mR=({activeId:t,activeWorkspace:a,activeWorkerId:o,bootstrapError:i,demoMode:l,onActiveWorkerChange:u,onDeleteWorkspace:f,onExitDemo:p,onOrchestratorRunClosed:g,onRequestAddWorkspace:m,onShellRunClosed:b,onShellRunStarted:v,onTryDemo:k,orchestratorAutostartErrors:S,recordOrchestratorResult:E,terminalRuns:w,workerActions:C,workers:T,workspacesLoading:N,showInlineActionCenter:A})=>l?c.jsx(sC,{onExit:p}):N&&!a?c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx(Va,{size:24,className:"animate-spin text-ter"})}):c.jsx(fR,{activeWorkerId:o,onCreateWorker:C.createWorker,onDeleteWorker:C.deleteWorker,onDeleteWorkspace:f,onStartWorker:C.startWorker,onStopWorker:C.stopWorkerRun,onRestartWorker:C.restartWorkerRun,onOrchestratorResult:E,onOrchestratorRunClosed:g,onRequestAddWorkspace:m,onShellRunClosed:b,onShellRunStarted:v,onTryDemo:k,onActiveWorkerChange:u,welcomeDisabledReason:i??void 0,orchestratorAutostartError:t?S[t]??null:null,terminalRuns:w,workers:T,workspace:a,showInlineActionCenter:A}),zl={id:"demo-workspace",name:"demo-todo-app",path:"/Users/you/demo-todo-app"},pR=[{id:"demo-coder",name:"ada-lovelace",role:"coder",status:"working",pendingTaskCount:1,lastPtyLine:"Editing src/routes/todos.ts (line 42)",commandPresetId:"claude"},{id:"demo-reviewer",name:"socrates",role:"reviewer",status:"idle",pendingTaskCount:0,commandPresetId:"gemini"}],hR=`# Todo app
|
|
74
|
-
|
|
75
|
-
- [x] Set up Express server
|
|
76
|
-
- [x] Add /todos GET endpoint
|
|
77
|
-
- [ ] Add /todos POST endpoint
|
|
78
|
-
- [ ] Write Vitest for both endpoints
|
|
79
|
-
- [ ] Wire up SQLite for persistence
|
|
80
|
-
`,gR=()=>{const[t,a]=y.useState(!1);return{demoMode:t,enableDemo:()=>a(!0),exitDemo:()=>a(!1)}},vR=t=>{const{demoMode:a,workspaces:o,activeWorkspaceId:i,workersByWorkspaceId:l}=t,u=a?[zl]:o,f=a?{[zl.id]:pR}:l,p=a?zl.id:i,g=a?zl:o?.find(b=>b.id===i);return{effectiveActiveWorkspaceId:p,effectiveWorkspaces:u,effectiveWorkersByWorkspaceId:f,effectiveActiveWorkspace:g,pollWorkspaceId:a?null:i}},yR=[{accent:"var(--status-green)",descriptionKey:"notifications.sound.soft.description",labelKey:"notifications.sound.soft.label",length:"short",value:"soft"},{accent:"var(--status-blue)",descriptionKey:"notifications.sound.ping.description",labelKey:"notifications.sound.ping.label",length:"short",value:"ping"},{accent:"var(--status-gold)",descriptionKey:"notifications.sound.chime.description",labelKey:"notifications.sound.chime.label",length:"short",value:"chime"},{accent:"var(--accent)",descriptionKey:"notifications.sound.cascade.description",labelKey:"notifications.sound.cascade.label",length:"long",value:"cascade"},{accent:"var(--status-orange)",descriptionKey:"notifications.sound.beacon.description",labelKey:"notifications.sound.beacon.label",length:"long",value:"beacon"},{accent:"var(--status-purple)",descriptionKey:"notifications.sound.resolve.description",labelKey:"notifications.sound.resolve.label",length:"long",value:"resolve"},{accent:"var(--text-tertiary)",descriptionKey:"notifications.sound.off.description",labelKey:"notifications.sound.off.label",length:"silent",value:"off"}],bR=[{descriptionKey:"notifications.detail.brief.description",labelKey:"notifications.detail.brief.label",value:"brief"},{descriptionKey:"notifications.detail.detailed.description",labelKey:"notifications.detail.detailed.label",value:"detailed"}],wR=()=>{const{t}=Se(),a=xt(),[o,i]=y.useState(!1),l=y.useRef(null),u=y.useRef(null),{notify:f,previewSound:p,requestDesktopNotifications:g,settings:m,updateSettings:b}=Rc(),v=typeof window<"u"&&!("Notification"in window),k=y.useMemo(()=>yR.map(w=>({...w,description:t(w.descriptionKey),label:t(w.labelKey)})),[t]),S=y.useMemo(()=>bR.map(w=>({...w,description:t(w.descriptionKey),label:t(w.labelKey)})),[t]),E=w=>{if(!w){b({desktop:!1});return}g()};return y.useEffect(()=>{if(!o)return;const w=T=>{T.key==="Escape"&&(i(!1),u.current?.focus())},C=T=>{const N=l.current;N&&!N.contains(T.target)&&i(!1)};return document.addEventListener("keydown",w),document.addEventListener("pointerdown",C),()=>{document.removeEventListener("keydown",w),document.removeEventListener("pointerdown",C)}},[o]),c.jsxs("div",{ref:l,className:"relative",children:[c.jsx(et,{label:t("notifications.settings.tooltip"),children:c.jsx("button",{ref:u,type:"button","aria-expanded":o,"aria-haspopup":"dialog","aria-label":t("notifications.settings.aria"),className:"flex h-7 w-7 max-md:min-w-11 cursor-pointer items-center justify-center rounded text-sec hover:bg-3 hover:text-pri","data-testid":"topbar-settings",onClick:()=>i(w=>!w),children:c.jsx(Pf,{size:14,"aria-hidden":!0})})}),o?c.jsxs("div",{role:"dialog","aria-modal":a?"true":void 0,"aria-label":t("notifications.settings.aria"),className:a?"fixed inset-0 z-50 flex flex-col overflow-y-auto":"elev-2 absolute top-8 right-0 z-50 w-[380px] rounded border p-3",style:a?{background:"var(--bg-0)"}:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},"data-testid":"notification-settings",children:[c.jsxs("div",{className:a?"flex shrink-0 items-center gap-2 border-b px-4 py-3":"mb-3 flex items-start gap-2",style:a?{borderColor:"var(--border)"}:void 0,children:[c.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded bg-3 text-sec",children:c.jsx(Pf,{size:16,"aria-hidden":!0})}),c.jsxs("div",{className:a?"min-w-0 flex-1":"min-w-0",children:[c.jsx("div",{className:"text-sm font-semibold text-pri",children:t("notifications.settings.heading")}),a?null:c.jsx("div",{className:"text-ter text-xs",children:t("notifications.settings.subtitle")})]}),a?c.jsx("button",{type:"button","aria-label":t("common.close"),className:"flex h-11 w-11 shrink-0 items-center justify-center rounded text-sec hover:bg-3 hover:text-pri",onClick:()=>i(!1),children:c.jsx(Ga,{size:20,"aria-hidden":!0})}):null]}),c.jsxs("div",{className:a?"flex-1 overflow-y-auto p-4":"contents",children:[c.jsxs("section",{className:"mb-3",children:[c.jsxs("div",{className:"mb-2 flex items-center gap-1.5 text-ter text-xs uppercase tracking-wider",children:[c.jsx(Zl,{size:12,"aria-hidden":!0}),t("notifications.sound.sectionLabel")]}),c.jsx("div",{role:"radiogroup","aria-label":t("notifications.sound.sectionLabel"),className:a?"grid grid-cols-1 gap-2":"grid grid-cols-2 gap-2",children:k.map(w=>c.jsxs("div",{className:"relative min-h-[78px] rounded border transition-colors",style:{background:m.sound===w.value?`color-mix(in oklab, ${w.accent} 10%, var(--bg-2))`:"var(--bg-2)",borderColor:m.sound===w.value?`color-mix(in oklab, ${w.accent} 54%, var(--border-bright))`:"var(--border)"},children:[c.jsxs("label",{className:"block h-full w-full cursor-pointer rounded px-3 py-2 pr-10 text-left transition-colors hover:bg-3 focus-within:outline-none focus-within:ring-2 focus-within:ring-[var(--ring-focus)]",children:[c.jsx("input",{type:"radio",name:"notification-sound",value:w.value,checked:m.sound===w.value,className:"sr-only",onChange:()=>b({sound:w.value})}),c.jsxs("span",{className:"mb-1 flex items-center gap-2",children:[c.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded",style:{background:`color-mix(in oklab, ${w.accent} 16%, transparent)`,color:w.accent},children:w.value==="off"?c.jsx(o0,{size:12,"aria-hidden":!0}):c.jsx(Zl,{size:12,"aria-hidden":!0})}),c.jsx("span",{className:"font-medium text-pri text-xs",children:w.label}),w.length==="long"?c.jsx("span",{className:"rounded border border-[var(--border-bright)] px-1.5 py-0.5 text-xs text-ter uppercase",children:t("notifications.sound.longerBadge")}):null,m.sound===w.value?c.jsx(Ja,{size:12,className:"ml-auto text-pri","aria-hidden":!0}):null]}),c.jsx("span",{className:"block text-ter text-xs",children:w.description})]}),w.value!=="off"?c.jsx("button",{type:"button","aria-label":t("notifications.sound.previewAria",{label:w.label}),className:"absolute right-2 bottom-2 flex h-6 w-6 pointer-coarse:h-10 pointer-coarse:w-10 items-center justify-center rounded border text-sec transition-colors hover:bg-3 hover:text-pri",style:{borderColor:"var(--border-bright)"},onClick:()=>p(w.value),children:c.jsx(Ao,{size:12,"aria-hidden":!0})}):null]},w.value))})]}),c.jsxs("section",{className:"mb-3",children:[c.jsxs("div",{className:"mb-2 flex items-center gap-1.5 text-ter text-xs uppercase tracking-wider",children:[c.jsx(Jb,{size:12,"aria-hidden":!0}),t("notifications.detail.sectionLabel")]}),c.jsx("div",{role:"radiogroup","aria-label":t("notifications.detail.sectionLabel"),className:"grid grid-cols-2 rounded border p-1",style:{background:"var(--bg-1)",borderColor:"var(--border)"},children:S.map(w=>c.jsxs("label",{className:"cursor-pointer rounded px-3 py-2 text-left transition-colors hover:bg-3 focus-within:outline-none focus-within:ring-2 focus-within:ring-[var(--ring-focus)]",style:{background:m.detail===w.value?"var(--bg-3)":"transparent",color:m.detail===w.value?"var(--text-primary)":"var(--text-secondary)"},children:[c.jsx("input",{type:"radio",name:"notification-detail",value:w.value,checked:m.detail===w.value,className:"sr-only",onChange:()=>b({detail:w.value})}),c.jsx("span",{className:"block font-medium text-xs",children:w.label}),c.jsx("span",{className:"block text-ter text-xs",children:w.description})]},w.value))})]}),c.jsxs("label",{className:"mb-3 flex items-start gap-2 rounded border p-2 text-sec text-xs",children:[c.jsx("input",{type:"checkbox","aria-label":t("notifications.desktop.aria"),checked:m.desktop,disabled:v,className:"mt-0.5",onChange:w=>E(w.currentTarget.checked)}),c.jsxs("span",{children:[c.jsx("span",{className:"block font-medium text-pri",children:t("notifications.desktop.label")}),c.jsx("span",{className:"text-ter",children:t(v?"notifications.desktop.unsupported":"notifications.desktop.helper")})]})]}),c.jsxs("div",{className:"flex justify-end gap-2 border-t pt-3",style:{borderColor:"var(--border)"},children:[c.jsx("button",{type:"button",className:"icon-btn",onClick:()=>i(!1),children:t("common.close")}),c.jsx("button",{type:"button",className:"icon-btn icon-btn--primary",onClick:()=>f({brief:t("notifications.test.brief"),detail:t("notifications.test.detail"),kind:"success",title:t("notifications.test.title")}),children:t("notifications.test.button")})]})]})]}):null]})},dx=({checked:t,disabled:a,onChange:o,...i})=>c.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":i["aria-label"],disabled:a,className:"settings-switch","data-checked":t||void 0,"data-testid":i["data-testid"],onClick:l=>{l.stopPropagation(),o(!t)},children:c.jsx("span",{className:"settings-switch__thumb"})}),xR=t=>Math.max(0,Math.ceil((t-Date.now())/1e3)),kR=()=>{const{t}=Se(),[a,o]=y.useState(null),[i,l]=y.useState(!1),[u,f]=y.useState(!1),[p,g]=y.useState(()=>Date.now());y.useEffect(()=>{if(!a)return;const k=window.setInterval(()=>g(Date.now()),1e3);return()=>window.clearInterval(k)},[a]);const m=async()=>{f(!1),l(!0);try{const k=await AN();o(k),g(Date.now())}catch{f(!0)}finally{l(!1)}};if(!a)return c.jsxs("div",{className:"p-1.5",children:[c.jsxs("button",{type:"button","data-testid":"settings-remote-add-device",onClick:()=>{m()},disabled:i,className:"icon-btn icon-btn--primary flex items-center gap-1.5",children:[c.jsx(n0,{size:14,"aria-hidden":!0}),t("remote.addDevice")]}),u?c.jsx("div",{className:"mt-1 text-xs",style:{color:"var(--text-error)"},role:"alert",children:t("remote.qr.startFailed")}):null]});const b=xR(a.expiresAt),v=b<=0||p>=a.expiresAt;return c.jsxs("div",{className:"p-1.5","data-testid":"remote-qr-panel",children:[c.jsx("div",{className:"text-sm font-medium text-pri",children:t("remote.qr.title")}),c.jsx("p",{className:"mt-0.5 mb-2 text-xs text-ter",children:t("remote.qr.instructions")}),c.jsxs("div",{className:"flex flex-col items-center gap-2",children:[v?c.jsx("div",{className:"text-xs",style:{color:"var(--text-error)"},"data-testid":"remote-qr-expired",children:t("remote.qr.expired")}):c.jsxs(c.Fragment,{children:[c.jsx("div",{"data-testid":"remote-pair-code",className:"mono rounded-lg border px-4 py-3 text-center text-2xl font-semibold tracking-[0.18em] text-pri",style:{borderColor:"var(--border)"},children:a.code}),c.jsx("div",{className:"text-xs text-ter","data-testid":"remote-qr-countdown",children:t("remote.qr.expiresIn",{seconds:b})})]}),c.jsxs("div",{className:"flex gap-2",children:[v?c.jsx("button",{type:"button","data-testid":"remote-qr-regenerate",onClick:()=>{m()},disabled:i,className:"icon-btn icon-btn--primary",children:t("remote.qr.regenerate")}):null,c.jsx("button",{type:"button","data-testid":"remote-qr-cancel",onClick:()=>o(null),className:"icon-btn",children:t("remote.qr.cancel")})]})]})]})},SR={ok:"remote.audit.result.ok",rejected:"remote.audit.result.rejected",error:"remote.audit.result.error"},ER=t=>{const a=Math.max(0,Date.now()-t),o=Math.floor(a/1e3);if(o<60)return"<1m";const i=Math.floor(o/60);if(i<60)return`${i}m`;const l=Math.floor(i/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`},CR=()=>{const{t}=Se(),[a,o]=y.useState(!1),[i,l]=y.useState(null),[u,f]=y.useState(!1),p=y.useCallback(async()=>{f(!1);try{l(await MN(100))}catch{f(!0)}},[]);return y.useEffect(()=>{a&&p()},[a,p]),c.jsxs("div",{className:"mt-2","data-testid":"remote-audit-view",children:[c.jsxs("button",{type:"button","data-testid":"remote-audit-toggle",onClick:()=>o(g=>!g),className:"flex w-full items-center gap-1.5 rounded px-2 py-1.5 text-xs font-medium text-sec transition-colors hover:bg-3 hover:text-pri","aria-expanded":a,children:[c.jsx(gc,{size:12,"aria-hidden":!0,className:"shrink-0"}),c.jsx("span",{className:"flex-1 text-left",children:t(a?"remote.audit.hide":"remote.audit.show")}),a?c.jsx(_o,{size:12,"aria-hidden":!0,className:"shrink-0 text-ter"}):c.jsx(vc,{size:12,"aria-hidden":!0,className:"shrink-0 text-ter"})]}),a?c.jsx("div",{className:"mt-1.5",children:u?c.jsx("div",{className:"rounded px-2 py-2 text-xs",style:{color:"var(--text-error)",background:"color-mix(in oklab, var(--status-red) 8%, transparent)"},role:"alert",children:t("remote.audit.loadFailed")}):!i||i.length===0?c.jsx("div",{className:"px-2 py-2 text-xs text-ter",children:t("remote.audit.empty")}):c.jsx("ul",{className:"scroll-y flex max-h-[160px] flex-col gap-px rounded border",style:{borderColor:"var(--border)",background:"var(--bg-0)"},children:i.map(g=>{const m=g.result!=="ok";return c.jsxs("li",{className:"flex items-center gap-2 px-2.5 py-1.5 text-xs","data-testid":`remote-audit-row-${g.id}`,style:m?{background:"color-mix(in oklab, var(--status-red) 6%, transparent)"}:void 0,children:[c.jsx("span",{className:"inline-block h-1.5 w-1.5 shrink-0 rounded-full",style:{background:m?"var(--status-red)":"var(--status-green)"},"aria-hidden":!0}),c.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[c.jsx("span",{className:"font-medium text-pri",children:g.action}),g.endpoint?c.jsx("span",{className:"ml-1 text-ter",children:g.endpoint}):null,g.preview?c.jsxs("span",{className:"ml-1 text-ter",children:["· ",g.preview]}):null,typeof g.byteCount=="number"?c.jsxs("span",{className:"ml-1 text-ter",children:["· ",t("remote.audit.bytes",{count:g.byteCount})]}):null]}),m?c.jsxs("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium",style:{color:"color-mix(in oklab, var(--status-red) 55%, white)",background:"color-mix(in oklab, var(--status-red) 14%, transparent)"},children:[t(SR[g.result]),g.rejectReason?` · ${g.rejectReason}`:""]}):null,c.jsx("span",{className:"shrink-0 tabular-nums text-ter",children:ER(g.ts)})]},g.id)})})}):null]})},Vy=t=>{const a=Math.max(0,Date.now()-t),o=Math.floor(a/6e4);if(o<1)return"<1m";if(o<60)return`${o}m`;const i=Math.floor(o/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`},TR=({reloadKey:t=0})=>{const{t:a}=Se(),o=tn(),[i,l]=y.useState(null),[u,f]=y.useState(!1),[p,g]=y.useState(null),m=y.useCallback(async()=>{f(!1);try{const k=await tw();l(k)}catch{f(!0)}},[]);y.useEffect(()=>{m()},[m,t]);const b=async k=>{try{await DN(k.deviceId),o.show({kind:"success",message:a("remote.devices.revoked",{name:k.name})}),await m()}catch{o.show({kind:"error",message:a("remote.devices.revokeFailed")})}},v=(i??[]).filter(k=>!k.revoked);return c.jsxs("div",{className:"p-1.5","data-testid":"remote-device-list",children:[c.jsx("div",{className:"mb-1 text-xs font-medium uppercase tracking-wider text-ter",children:a("remote.devices.heading")}),u?c.jsx("div",{className:"text-xs",style:{color:"var(--text-error)"},role:"alert",children:a("remote.devices.loadFailed")}):v.length===0?c.jsx("div",{className:"text-xs text-ter",children:a("remote.devices.empty")}):c.jsx("ul",{className:"flex flex-col gap-1",children:v.map(k=>c.jsxs("li",{className:"flex items-center justify-between gap-2 rounded p-1.5 hover:bg-3","data-testid":`remote-device-${k.deviceId}`,children:[c.jsxs("span",{className:"min-w-0",children:[c.jsx("span",{className:"block truncate text-sm text-pri",children:k.name}),c.jsx("span",{className:"block text-xs text-ter",children:k.lastActive===null?a("remote.devices.neverActive"):Vy(k.lastActive)==="<1m"?a("remote.devices.activeNow"):a("remote.devices.lastActive",{ago:Vy(k.lastActive)})})]}),c.jsx("button",{type:"button","data-testid":`remote-device-revoke-${k.deviceId}`,"aria-label":a("remote.devices.revokeAria",{name:k.name}),onClick:()=>g(k),className:"icon-btn icon-btn--danger shrink-0",children:a("remote.devices.revoke")})]},k.deviceId))}),c.jsx(ci,{open:p!==null,onOpenChange:k=>{k||g(null)},title:a("remote.devices.revokeTitle"),description:p?a("remote.devices.revokeConfirm",{name:p.name}):"",confirmLabel:a("remote.devices.revoke"),confirmKind:"danger",onConfirm:()=>{p&&b(p)}})]})},NR=2e3,tm={enabled:!1,loggedIn:!1,gatewayUrl:null,connected:!1,connection:"disabled"},fx=y.createContext({status:tm,loading:!0,setEnabled:async()=>{},pending:null,refresh:async()=>{}}),jR=({children:t})=>{const a=xt(),[o,i]=y.useState(tm),[l,u]=y.useState(!0),[f,p]=y.useState(null);y.useEffect(()=>{let v=!1;return pf().then(k=>{v||i(k)}).catch(()=>{}).finally(()=>{v||u(!1)}),()=>{v=!0}},[]);const g=y.useCallback(async v=>{const k=await _N(v);i(k),k.enabled||p(null)},[]),m=y.useCallback(async()=>{const v=await pf().catch(()=>tm);i(v),v.enabled&&v.loggedIn&&!a?p(await Ty().catch(()=>null)):p(null)},[a]),b=o.enabled&&o.loggedIn&&!a;return y.useEffect(()=>{if(!b){p(null);return}let v=!1;const k=()=>{pf().then(E=>{v||i(E)}).catch(()=>{}),Ty().then(E=>{v||p(E)}).catch(()=>{})};k();const S=window.setInterval(k,NR);return()=>{v=!0,window.clearInterval(S)}},[b]),c.jsx(fx.Provider,{value:{status:o,loading:l,setEnabled:g,pending:f,refresh:m},children:t})},$m=()=>y.useContext(fx),_R={online:"var(--status-green)",connecting:"var(--status-amber, #d29922)",reconnecting:"var(--status-amber, #d29922)",revoked:"var(--status-red, #f85149)",loggedOut:"var(--text-ter)",disabled:"var(--text-ter)"},AR={connecting:"remote.status.connecting",reconnecting:"remote.status.reconnecting",revoked:"remote.status.revoked"},RR=()=>{const{t}=Se(),a=tn(),o=xt(),{status:i,loading:l,setEnabled:u,pending:f}=$m(),p=_R[i.connection],g=AR[i.connection],[m,b]=y.useState(!1),[v,k]=y.useState(!1),[S,E]=y.useState(!1),[w,C]=y.useState(!1),[T,N]=y.useState(!1),[A,j]=y.useState(null),[O,D]=y.useState(!1),L=y.useRef(null),[q,$]=y.useState(0),ae=y.useRef(!1);y.useEffect(()=>{f?ae.current=!0:ae.current&&(ae.current=!1,$(I=>I+1))},[f]),y.useEffect(()=>()=>{L.current&&clearTimeout(L.current)},[]),y.useEffect(()=>{let I=!1;return WN().then(Z=>{I||(j(Z),D(!1))}).catch(()=>{I||D(!0)}),()=>{I=!0}},[]);const G=async I=>{k(!1),b(!0);try{await u(I)}catch{k(!0)}finally{b(!1)}},W=I=>{if(!I&&o){E(!0);return}G(I)},ee=async()=>{if(!w){C(!0);try{const I=UN().then(Z=>JSON.stringify(Z,null,2));await aw(I),N(!0),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{N(!1),L.current=null},1200),a.show({kind:"success",message:t("remote.diagnostics.copied")})}catch{a.show({kind:"error",message:t("remote.diagnostics.copyFailed")})}finally{C(!1)}}},Q=A?.current_streak_days??0,V=A?.days_active_total??0,M=A?.totals?.send??0,P=A?.totals?.report??0;return c.jsxs("div",{className:"settings-section","data-testid":"remote-access-section",children:[c.jsxs("div",{className:"settings-section__heading",children:[c.jsx(n0,{size:12,"aria-hidden":!0}),c.jsx("span",{children:t("remote.section")})]}),c.jsxs("div",{className:"settings-toggle-row",onClick:()=>{!l&&!m&&W(!i.enabled)},children:[c.jsxs("span",{className:"min-w-0 flex-1 text-left",children:[c.jsx("span",{className:"block text-sm font-medium text-pri",children:t("remote.enable.label")}),c.jsx("span",{className:"mt-0.5 block text-xs text-ter leading-relaxed",children:t("remote.enable.description")})]}),c.jsx("div",{className:"mt-0.5 shrink-0",children:c.jsx(dx,{checked:i.enabled,disabled:l||m,onChange:W,"data-testid":"settings-toggle-remote","aria-label":t("remote.enable.label")})})]}),v?c.jsx("div",{className:"mt-1 ml-2 text-xs",style:{color:"var(--text-error)"},role:"alert",children:t("settings.saveError")}):null,c.jsxs("button",{type:"button","data-testid":"remote-copy-diagnostics",onClick:ee,disabled:w,className:"icon-btn mt-2 w-full justify-center pointer-coarse:min-h-11",children:[T?c.jsx(Ja,{size:12,"aria-hidden":!0}):c.jsx(Nr,{size:12,"aria-hidden":!0}),c.jsx("span",{children:t(w?"remote.diagnostics.copying":T?"remote.diagnostics.copied":"remote.diagnostics.copy")})]}),c.jsxs("div",{className:"mt-2 rounded border px-3 py-2 text-xs","data-testid":"retention-diagnostics-panel",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:[c.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[c.jsx("span",{className:"font-medium text-sec",children:t("remote.retention.title")}),c.jsx("span",{className:"text-ter",children:t("remote.retention.localOnly")})]}),O?c.jsx("p",{className:"text-ter",children:t("remote.retention.loadFailed")}):A?c.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-lg font-semibold text-pri",children:Q}),c.jsx("div",{className:"text-ter",children:t("remote.retention.streak")})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-lg font-semibold text-pri",children:V}),c.jsx("div",{className:"text-ter",children:t("remote.retention.activeDays")})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-lg font-semibold text-pri",children:M}),c.jsx("div",{className:"text-ter",children:t("remote.retention.sends")})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-lg font-semibold text-pri",children:P}),c.jsx("div",{className:"text-ter",children:t("remote.retention.reports")})]})]}):c.jsx("p",{className:"text-ter",children:t("common.loading")})]}),i.enabled?c.jsxs("div",{className:"mt-2 border-t pt-2",style:{borderColor:"var(--border)"},children:[c.jsxs("div",{className:"flex items-center gap-2 rounded px-2 py-1.5 text-xs","data-testid":"remote-login-status",children:[c.jsx("span",{"aria-hidden":!0,"data-connection":i.connection,className:"inline-block h-2 w-2 rounded-full",style:{background:p}}),c.jsx("span",{className:"min-w-0 text-sec",children:g?t(g):i.loggedIn?t("remote.status.linked",{gateway:i.gatewayUrl??""}):t("remote.status.notLinked")})]}),i.loggedIn&&!o?c.jsx(kR,{}):null,c.jsx(TR,{reloadKey:q}),c.jsx(CR,{})]}):null,c.jsx(ci,{open:S,onOpenChange:I=>{I||E(!1)},title:t("remote.disable.confirmTitle"),description:t("remote.disable.confirmBody"),confirmLabel:t("common.stop"),confirmKind:"danger",onConfirm:()=>{G(!1)}})]})},mx=y.createContext({enabled:!0,loading:!0,setEnabled:async()=>{}}),OR=({children:t})=>{const[a,o]=y.useState(!0),[i,l]=y.useState(!0);y.useEffect(()=>{let f=!1;return tN().then(p=>{f||o(p.enabled)}).catch(()=>{}).finally(()=>{f||l(!1)}),()=>{f=!0}},[]);const u=y.useCallback(async f=>{const p=await nN(f);o(p.enabled)},[]);return c.jsx(mx.Provider,{value:{enabled:a,loading:i,setEnabled:u},children:t})},DR=()=>y.useContext(mx),px=y.createContext({enabled:!1,loading:!0,setEnabled:async()=>{}}),MR=({children:t})=>{const[a,o]=y.useState(!1),[i,l]=y.useState(!0);y.useEffect(()=>{let f=!1;return JT().then(p=>{f||o(p.enabled)}).catch(()=>{}).finally(()=>{f||l(!1)}),()=>{f=!0}},[]);const u=y.useCallback(async f=>{const p=await eN(f);o(p.enabled)},[]);return c.jsx(px.Provider,{value:{enabled:a,loading:i,setEnabled:u},children:t})},hx=()=>y.useContext(px),LR=()=>{const{language:t,setLanguage:a,t:o}=Se();return c.jsxs("div",{className:"settings-section",children:[c.jsxs("div",{className:"settings-section__heading",children:[c.jsx(oE,{size:12,"aria-hidden":!0}),c.jsx("span",{children:o("settings.language")})]}),c.jsxs("div",{className:"flex gap-1 p-1 rounded border",style:{background:"var(--bg-1)",borderColor:"var(--border)"},children:[c.jsx("button",{type:"button",className:"flex-1 py-1 px-2 rounded text-xs font-medium transition-colors cursor-pointer",style:{background:t==="zh"?"var(--bg-3)":"transparent",color:t==="zh"?"var(--text-primary)":"var(--text-secondary)",border:"none"},onClick:()=>a("zh"),"data-testid":"language-zh-btn",children:"中文"}),c.jsx("button",{type:"button",className:"flex-1 py-1 px-2 rounded text-xs font-medium transition-colors cursor-pointer",style:{background:t==="en"?"var(--bg-3)":"transparent",color:t==="en"?"var(--text-primary)":"var(--text-secondary)",border:"none"},onClick:()=>a("en"),"data-testid":"language-en-btn",children:"English"})]})]})},Gy=({feature:t,label:a,description:o,testId:i})=>{const{t:l}=Se(),[u,f]=y.useState(!1),[p,g]=y.useState(!1),m=async b=>{g(!1),f(!0);try{await t.setEnabled(b)}catch{g(!0)}finally{f(!1)}};return c.jsxs("div",{className:"settings-toggle-row",onClick:()=>{!t.loading&&!u&&m(!t.enabled)},children:[c.jsxs("span",{className:"min-w-0 flex-1 text-left",children:[c.jsx("span",{className:"block text-sm font-medium text-pri",children:a}),c.jsx("span",{className:"mt-0.5 block text-xs text-ter leading-relaxed",children:o}),p?c.jsx("span",{className:"mt-1 block text-xs",style:{color:"var(--text-error)"},role:"alert",children:l("settings.saveError")}):null]}),c.jsx("div",{className:"mt-0.5 shrink-0",children:c.jsx(dx,{checked:t.enabled,disabled:t.loading||u,onChange:b=>{m(b)},"data-testid":i,"aria-label":a})})]})},zR=()=>{const{t}=Se(),[a,o]=y.useState(""),[i,l]=y.useState(!1),[u,f]=y.useState(!1),[p,g]=y.useState(null);y.useEffect(()=>{let b=!1;return ZT().then(v=>{b||(o(v),l(!0))}).catch(()=>{b||l(!0)}),()=>{b=!0}},[]);const m=async()=>{g(null),f(!0);try{await QT(a),g("saved")}catch{g("error")}finally{f(!1)}};return c.jsxs("div",{children:[c.jsx("label",{className:"mb-1.5 block text-sm font-medium text-pri",htmlFor:"settings-webhook-url",children:t("settings.webhook.label")}),c.jsx("span",{className:"mb-2 block text-xs text-ter leading-relaxed",children:t("settings.webhook.description")}),c.jsx("input",{id:"settings-webhook-url",type:"url",inputMode:"url",placeholder:"https://…",className:"input",value:a,disabled:!i||u,onChange:b=>{g(null),o(b.target.value)},onBlur:()=>{m()},onKeyDown:b=>{if(b.key==="Enter"){if(b.nativeEvent.isComposing||b.keyCode===229)return;b.currentTarget.blur()}},"data-testid":"settings-webhook-url"}),p==="saved"?c.jsxs("span",{className:"mt-1.5 block text-xs",style:{color:"var(--status-green)"},children:["✓ ",t("settings.webhook.saved")]}):null,p==="error"?c.jsx("span",{className:"mt-1.5 block text-xs",style:{color:"var(--text-error)"},role:"alert",children:t("settings.saveError")}):null]})},gx=()=>{const{t}=Se(),a=hx(),o=DR();return c.jsxs("div",{className:"flex flex-col gap-2.5",children:[c.jsx(LR,{}),c.jsxs("div",{className:"settings-section",children:[c.jsxs("div",{className:"settings-section__heading",children:[c.jsx(Gl,{size:12,"aria-hidden":!0}),c.jsx("span",{children:t("settings.experimental")})]}),c.jsx(Gy,{feature:a,label:t("settings.workflows.label"),description:t("settings.workflows.description"),testId:"settings-toggle-workflows"}),c.jsx(Gy,{feature:o,label:t("settings.autostaff.label"),description:t("settings.autostaff.description"),testId:"settings-toggle-autostaff"})]}),c.jsx(RR,{}),c.jsxs("div",{className:"settings-section",children:[c.jsxs("div",{className:"settings-section__heading",children:[c.jsx($E,{size:12,"aria-hidden":!0}),c.jsx("span",{children:t("settings.webhook.label")})]}),c.jsx(zR,{})]})]})},vx=()=>{const{t}=Se(),a=xt(),[o,i]=y.useState(!1),l=y.useRef(null),u=y.useRef(null);return y.useEffect(()=>{if(!o)return;const f=g=>{g.key==="Escape"&&(i(!1),u.current?.focus())},p=g=>{const m=l.current;m&&!m.contains(g.target)&&i(!1)};return document.addEventListener("keydown",f),document.addEventListener("pointerdown",p),()=>{document.removeEventListener("keydown",f),document.removeEventListener("pointerdown",p)}},[o]),c.jsxs("div",{ref:l,className:"relative",children:[c.jsx(et,{label:t("settings.tooltip"),children:c.jsx("button",{ref:u,type:"button","aria-expanded":o,"aria-haspopup":"dialog","aria-label":t("settings.aria"),className:"flex h-7 w-7 cursor-pointer items-center justify-center rounded text-sec hover:bg-3 hover:text-pri","data-testid":"topbar-app-settings",onClick:()=>i(f=>!f),children:c.jsx(Ff,{size:14,"aria-hidden":!0})})}),o?c.jsxs("div",{role:"dialog","aria-label":t("settings.aria"),className:a?"settings-sheet fixed inset-0 z-50 flex flex-col overflow-y-auto p-4":"settings-popover elev-2 absolute top-8 right-0 z-50 w-[380px] max-h-[calc(100vh-64px)] overflow-y-auto scroll-y rounded-lg border p-4","data-mobile":a||void 0,style:a?{background:"var(--bg-0)"}:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},"data-testid":"app-settings-menu",children:[c.jsxs("div",{className:"mb-4 flex items-start gap-3",children:[c.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg",style:{background:"color-mix(in oklab, var(--accent) 12%, transparent)",color:"var(--accent)"},children:c.jsx(Ff,{size:18,"aria-hidden":!0})}),c.jsxs("div",{className:a?"min-w-0 flex-1":"min-w-0",children:[c.jsx("div",{className:"text-sm font-semibold text-pri",children:t("settings.heading")}),c.jsx("div",{className:"text-xs text-ter",children:t("settings.subtitle")})]}),a?c.jsx("button",{type:"button",onClick:()=>i(!1),"aria-label":t("common.close"),"data-testid":"mobile-settings-close",className:"icon-btn icon-btn--ghost shrink-0",children:c.jsx(Ga,{size:16,"aria-hidden":!0})}):null]}),c.jsx(gx,{})]}):null]})},yx=t=>{const[a,o]=y.useState(null);return y.useEffect(()=>{if(t!==void 0)return;let i=!0;return FT().then(l=>{i&&o(l)}).catch(()=>{i&&o(null)}),()=>{i=!1}},[t]),t===void 0?a:t},HR="2.1.13",BR={version:HR},Vm=BR.version,UR=({actions:t,hideActions:a=!1,memoryOpen:o=!1,onToggleMemory:i,onToggleTaskGraph:l,openTaskCount:u=0,taskGraphOpen:f=!1,onToggleWorkflows:p,workflowsOpen:g=!1,version:m=Vm,versionInfo:b})=>{const{t:v}=Se(),[k,S]=y.useState("idle"),E=yx(b),w=E?.updateAvailable&&E.latestVersion!==m?E:null,C=!!w?.installHint,T=u>0,N=f?v("topbar.hideTodo"):T?v("topbar.todoOpen",{count:u}):v("topbar.showTodo"),A=async()=>{if(w?.installHint)try{await navigator.clipboard.writeText(w.installHint),S("copied"),window.setTimeout(()=>S("idle"),1600)}catch{S("error"),window.setTimeout(()=>S("idle"),2200)}},j=v(k==="copied"?"topbar.updateCommandCopied":k==="error"?"topbar.updateCommandCopyFailed":"topbar.copyUpdateCommand");return c.jsxs("header",{className:"flex h-11 shrink-0 items-center px-4",style:{background:"var(--bg-0)",borderBottom:"1px solid var(--border)"},children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsxs("a",{href:"https://hivehq.dev",target:"_blank",rel:"noopener noreferrer","aria-label":v("topbar.openWebsite"),title:v("topbar.openWebsite"),className:"-mx-1 flex items-center gap-2 rounded px-1 transition-opacity hover:opacity-80 focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)]","data-testid":"topbar-brand-link",children:[c.jsx("img",{src:"/logo.png",alt:"","aria-hidden":!0,className:"h-5 w-5 rounded-md","data-testid":"topbar-logo"}),c.jsx("span",{className:"font-semibold text-pri",children:"Hive"}),c.jsxs("span",{className:"text-ter text-xs tabular-nums",children:["v",m]})]}),w?c.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 text-xs","data-testid":"topbar-update-badge",children:[c.jsx("span",{className:"rounded border px-2 py-0.5 font-medium",style:{background:"color-mix(in oklab, var(--accent) 10%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 30%, transparent)",color:"var(--accent)"},children:v("topbar.updateAvailable")}),c.jsxs("span",{className:"hidden text-ter sm:inline",children:["v",m," → v",w.latestVersion]}),C?c.jsx("code",{className:"mono hidden max-w-[18rem] truncate rounded border px-1.5 py-0.5 text-ter md:inline-block",title:w.updateNote||w.installHint,style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:w.installHint}):null,w.updateNote?c.jsx("span",{className:"hidden max-w-[18rem] truncate text-ter xl:inline",title:w.updateNote,children:w.updateNote}):null,C?c.jsx(et,{label:j,children:c.jsx("button",{type:"button",onClick:A,"aria-label":j,className:"flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded border text-ter transition-colors hover:bg-3 hover:text-pri focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)]","data-testid":"topbar-copy-update-command",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:k==="copied"?c.jsx(Ja,{size:12}):c.jsx(Nr,{size:12})})}):null,w.releaseUrl?c.jsx(et,{label:v("topbar.openRelease"),children:c.jsx("a",{href:w.releaseUrl,target:"_blank",rel:"noopener noreferrer","aria-label":v("topbar.openRelease"),className:"flex h-6 w-6 shrink-0 items-center justify-center rounded border text-ter transition-colors hover:bg-3 hover:text-pri focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)]","data-testid":"topbar-open-release",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:c.jsx(Em,{size:12})})}):null]}):null]}),c.jsx("div",{className:"flex-1"}),a?null:c.jsxs("div",{className:"flex items-center gap-1",children:[t,i?c.jsx(et,{label:v(o?"topbar.hideMemory":"topbar.showMemory"),children:c.jsxs("button",{type:"button",onClick:i,"aria-pressed":o,"aria-label":v(o?"topbar.hideMemory":"topbar.showMemory"),className:"flex h-7 cursor-pointer items-center gap-1 rounded border px-2 text-xs font-medium text-ter transition-colors hover:bg-3 hover:text-pri focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)]","data-testid":"topbar-memory",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:[c.jsx(kS,{size:13}),c.jsx("span",{children:v("topbar.memory")})]})}):null,l?c.jsx(et,{label:N,children:c.jsxs("button",{type:"button",onClick:l,"aria-pressed":f,"aria-label":N,"data-has-tasks":T?"true":void 0,className:"flex h-7 cursor-pointer items-center gap-1 rounded border px-2 text-xs font-medium text-ter transition-colors hover:bg-3 hover:text-pri focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)]","data-testid":"topbar-blueprint",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:[c.jsx(e0,{size:13,className:T?"text-accent":void 0}),c.jsx("span",{children:v("topbar.todo")})]})}):null,p?c.jsx(et,{label:v(g?"topbar.hideWorkflows":"topbar.showWorkflows"),children:c.jsxs("button",{type:"button",onClick:p,"aria-pressed":g,"aria-label":v(g?"topbar.hideWorkflows":"topbar.showWorkflows"),className:"flex h-7 cursor-pointer items-center gap-1 rounded border px-2 text-xs font-medium text-ter transition-colors hover:bg-3 hover:text-pri focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)]","data-testid":"topbar-workflows",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:[c.jsx(s0,{size:13}),c.jsx("span",{children:v("topbar.workflows")})]})}):null,c.jsx(wR,{}),c.jsx(vx,{})]})]})},bx="hive.workspace-sidebar.width",Qs=56,Gm=280,jf=Qs,Xy=16,WR=240,Zy=96,Yl=t=>Math.min(Gm,Math.max(Qs,t)),IR=()=>{try{const t=localStorage.getItem(bx);if(!t)return jf;const a=Number.parseInt(t,10);return Number.isFinite(a)?Yl(a):jf}catch{return jf}},qR=()=>{const[t,a]=y.useState(IR),[o,i]=y.useState(!1);y.useEffect(()=>{try{localStorage.setItem(bx,String(Math.round(t)))}catch{}},[t]);const l=y.useCallback(g=>{g.preventDefault();const m=g.clientX,b=t;i(!0);const v=document.body.style.cursor,k=document.body.style.userSelect;document.body.style.cursor="col-resize",document.body.style.userSelect="none";const S=w=>{a(Yl(b+w.clientX-m))},E=()=>{i(!1),document.body.style.cursor=v,document.body.style.userSelect=k,document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",E)};document.addEventListener("mousemove",S),document.addEventListener("mouseup",E)},[t]),u=t<=Zy,f=y.useCallback(()=>{a(g=>g<=Zy?WR:Qs)},[]),p=y.useCallback(g=>{g.key==="ArrowLeft"?(g.preventDefault(),a(m=>Yl(m-Xy))):g.key==="ArrowRight"?(g.preventDefault(),a(m=>Yl(m+Xy))):g.key==="Home"?(g.preventDefault(),a(Qs)):g.key==="End"&&(g.preventDefault(),a(Gm))},[]);return{beginResize:l,collapsed:u,onResizeKeyDown:p,resizing:o,toggleCollapsed:f,width:t}},PR=({children:t,hideTopbarActions:a=!1,memoryOpen:o=!1,onToggleMemory:i,onToggleTaskGraph:l,openTaskCount:u=0,onToggleWorkflows:f,workflowsOpen:p=!1,sidebar:g,sidebarResize:m,taskGraphOpen:b=!1,topbarActions:v,versionInfo:k})=>{const{t:S}=Se();return c.jsxs("div",{className:"flex h-screen w-full flex-col overflow-hidden",style:{background:"var(--bg-0)",color:"var(--text-primary)"},children:[c.jsx(UR,{actions:v,hideActions:a,memoryOpen:o,onToggleMemory:i,onToggleTaskGraph:l,openTaskCount:u,taskGraphOpen:b,onToggleWorkflows:f,versionInfo:k,workflowsOpen:p}),c.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 overflow-hidden",children:[c.jsxs("aside",{"aria-label":S("layout.sidebarAria"),className:"workspace-sidebar relative flex shrink-0 flex-col","data-resizing":m.resizing?"true":"false",style:{background:"var(--bg-0)",boxShadow:"inset -1px 0 0 var(--border)",width:`${m.width}px`},children:[g,c.jsx("hr",{"aria-label":S("layout.sidebarResizeAria"),"aria-orientation":"vertical","aria-valuemin":Qs,"aria-valuemax":Gm,"aria-valuenow":Math.round(m.width),tabIndex:0,className:"workspace-sidebar-resizer","data-resizing":m.resizing?"true":"false",onMouseDown:m.beginResize,onKeyDown:m.onResizeKeyDown})]}),c.jsx("section",{className:"relative flex min-w-0 flex-1 overflow-hidden",children:t})]})]})},FR={disconnected:"mobile.reconnect.disconnected",reconnecting:"mobile.reconnect.reconnecting",revoked:"mobile.reconnect.revoked"},KR=({status:t})=>{const{t:a}=Se();if(!t||t.state!=="reconnecting"&&t.state!=="disconnected"&&t.state!=="revoked")return null;const o=t.state==="revoked"?"var(--status-red)":"var(--status-orange)",i=t.state==="disconnected"?t.retry:void 0;return c.jsxs("div",{role:"status","data-testid":"mobile-reconnect-banner",className:"flex items-center justify-center gap-2 px-3 py-1.5 text-center text-xs",style:{background:`color-mix(in oklab, ${o} 18%, var(--bg-0))`,color:o},children:[c.jsx("span",{children:a(FR[t.state])}),i?c.jsx("button",{type:"button","data-testid":"mobile-reconnect-retry",className:"rounded border px-2 py-0.5 font-medium",style:{borderColor:"currentColor",color:"currentColor"},onClick:i,children:a("mobile.reconnect.retry")}):null]})},YR=[{accent:"var(--status-green)",descriptionKey:"notifications.sound.soft.description",labelKey:"notifications.sound.soft.label",length:"short",value:"soft"},{accent:"var(--status-blue)",descriptionKey:"notifications.sound.ping.description",labelKey:"notifications.sound.ping.label",length:"short",value:"ping"},{accent:"var(--status-gold)",descriptionKey:"notifications.sound.chime.description",labelKey:"notifications.sound.chime.label",length:"short",value:"chime"},{accent:"var(--accent)",descriptionKey:"notifications.sound.cascade.description",labelKey:"notifications.sound.cascade.label",length:"long",value:"cascade"},{accent:"var(--status-orange)",descriptionKey:"notifications.sound.beacon.description",labelKey:"notifications.sound.beacon.label",length:"long",value:"beacon"},{accent:"var(--status-purple)",descriptionKey:"notifications.sound.resolve.description",labelKey:"notifications.sound.resolve.label",length:"long",value:"resolve"},{accent:"var(--text-tertiary)",descriptionKey:"notifications.sound.off.description",labelKey:"notifications.sound.off.label",length:"silent",value:"off"}],$R=[{descriptionKey:"notifications.detail.brief.description",labelKey:"notifications.detail.brief.label",value:"brief"},{descriptionKey:"notifications.detail.detailed.description",labelKey:"notifications.detail.detailed.label",value:"detailed"}],VR=()=>{const{t}=Se(),a=xt(),{notify:o,previewSound:i,requestDesktopNotifications:l,settings:u,updateSettings:f}=Rc(),p=typeof window<"u"&&!("Notification"in window),g=y.useMemo(()=>YR.map(v=>({...v,description:t(v.descriptionKey),label:t(v.labelKey)})),[t]),m=y.useMemo(()=>$R.map(v=>({...v,description:t(v.descriptionKey),label:t(v.labelKey)})),[t]),b=v=>{if(!v){f({desktop:!1});return}l()};return c.jsxs("details",{className:"settings-details group",children:[c.jsxs("summary",{className:"settings-details__summary",children:[c.jsxs("div",{className:"settings-section__heading !mb-0",children:[c.jsx(Pf,{size:12,"aria-hidden":!0}),c.jsx("span",{children:t("notifications.settings.heading")})]}),c.jsx(_o,{size:14,className:"text-sec transition-transform group-open:rotate-180","aria-hidden":!0})]}),c.jsxs("div",{className:"settings-details__content flex flex-col gap-3.5",children:[c.jsxs("section",{children:[c.jsxs("div",{className:"mb-2 flex items-center gap-1.5 text-ter text-[10px] font-semibold uppercase tracking-wider",children:[c.jsx(Zl,{size:12,"aria-hidden":!0}),t("notifications.sound.sectionLabel")]}),c.jsx("div",{role:"radiogroup","aria-label":t("notifications.sound.sectionLabel"),className:a?"grid grid-cols-1 gap-2":"grid grid-cols-2 gap-2",children:g.map(v=>c.jsxs("div",{className:"relative min-h-[78px] rounded border transition-colors",style:{background:u.sound===v.value?`color-mix(in oklab, ${v.accent} 10%, var(--bg-2))`:"var(--bg-2)",borderColor:u.sound===v.value?`color-mix(in oklab, ${v.accent} 54%, var(--border-bright))`:"var(--border)"},children:[c.jsxs("label",{className:"block h-full w-full cursor-pointer rounded px-3 py-2 pr-10 text-left transition-colors hover:bg-3 focus-within:outline-none focus-within:ring-2 focus-within:ring-[var(--ring-focus)]",children:[c.jsx("input",{type:"radio",name:"notification-sound",value:v.value,checked:u.sound===v.value,className:"sr-only",onChange:()=>f({sound:v.value})}),c.jsxs("span",{className:"mb-1 flex items-center gap-2",children:[c.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded",style:{background:`color-mix(in oklab, ${v.accent} 16%, transparent)`,color:v.accent},children:v.value==="off"?c.jsx(o0,{size:12,"aria-hidden":!0}):c.jsx(Zl,{size:12,"aria-hidden":!0})}),c.jsx("span",{className:"font-medium text-pri text-xs",children:v.label}),v.length==="long"?c.jsx("span",{className:"rounded border border-[var(--border-bright)] px-1.5 py-0.5 text-[10px] text-ter uppercase",children:t("notifications.sound.longerBadge")}):null,u.sound===v.value?c.jsx(Ja,{size:12,className:"ml-auto text-pri","aria-hidden":!0}):null]}),c.jsx("span",{className:"block text-ter text-[11px] leading-relaxed",children:v.description})]}),v.value!=="off"?c.jsx("button",{type:"button","aria-label":t("notifications.sound.previewAria",{label:v.label}),className:"absolute right-2 bottom-2 flex h-6 w-6 pointer-coarse:h-10 pointer-coarse:w-10 items-center justify-center rounded border text-sec transition-colors hover:bg-3 hover:text-pri cursor-pointer",style:{borderColor:"var(--border-bright)"},onClick:()=>i(v.value),children:c.jsx(Ao,{size:12,"aria-hidden":!0})}):null]},v.value))})]}),c.jsxs("section",{children:[c.jsxs("div",{className:"mb-2 flex items-center gap-1.5 text-ter text-[10px] font-semibold uppercase tracking-wider",children:[c.jsx(Jb,{size:12,"aria-hidden":!0}),t("notifications.detail.sectionLabel")]}),c.jsx("div",{role:"radiogroup","aria-label":t("notifications.detail.sectionLabel"),className:"grid grid-cols-2 rounded border p-1",style:{background:"var(--bg-1)",borderColor:"var(--border)"},children:m.map(v=>c.jsxs("label",{className:"cursor-pointer rounded px-3 py-2 text-left transition-colors hover:bg-3 focus-within:outline-none focus-within:ring-2 focus-within:ring-[var(--ring-focus)]",style:{background:u.detail===v.value?"var(--bg-3)":"transparent",color:u.detail===v.value?"var(--text-primary)":"var(--text-secondary)"},children:[c.jsx("input",{type:"radio",name:"notification-detail",value:v.value,checked:u.detail===v.value,className:"sr-only",onChange:()=>f({detail:v.value})}),c.jsx("span",{className:"block font-medium text-xs",children:v.label}),c.jsx("span",{className:"block text-ter text-[11px] leading-relaxed",children:v.description})]},v.value))})]}),c.jsxs("label",{className:"flex items-start gap-2 rounded border p-2 text-sec text-xs cursor-pointer",children:[c.jsx("input",{type:"checkbox","aria-label":t("notifications.desktop.aria"),checked:u.desktop,disabled:p,className:"mt-0.5 cursor-pointer",onChange:v=>b(v.currentTarget.checked)}),c.jsxs("span",{children:[c.jsx("span",{className:"block font-medium text-pri",children:t("notifications.desktop.label")}),c.jsx("span",{className:"text-ter leading-relaxed",children:t(p?"notifications.desktop.unsupported":"notifications.desktop.helper")})]})]}),c.jsx("div",{className:"flex justify-end gap-2 border-t pt-3",style:{borderColor:"var(--border)"},children:c.jsx("button",{type:"button",className:"icon-btn icon-btn--primary ml-auto cursor-pointer",onClick:()=>o({brief:t("notifications.test.brief"),detail:t("notifications.test.detail"),kind:"success",title:t("notifications.test.title")}),children:t("notifications.test.button")})})]})]})},GR=({demoMode:t,onTryDemo:a,onExitDemo:o})=>{const{t:i}=Se();return c.jsxs("div",{className:"mobile-settings-section flex min-h-full flex-col p-4","data-testid":"mobile-settings-section",children:[c.jsx("h1",{className:"mb-4 text-base font-semibold text-pri",children:i("mobile.section.settings")}),c.jsx(gx,{}),c.jsx(VR,{}),c.jsxs("div",{className:"settings-section mt-3",children:[c.jsxs("div",{className:"settings-section__heading",children:[c.jsx(Gl,{size:12,"aria-hidden":!0}),c.jsx("span",{children:i("mobile.section.demo")})]}),t?c.jsxs("button",{type:"button","data-testid":"mobile-settings-exit-demo",onClick:o,className:"flex w-full items-center gap-3 rounded p-2 text-left text-sm text-pri hover:bg-3",children:[c.jsx(uE,{size:16,"aria-hidden":!0,className:"text-ter"}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:i("demo.exit")})]}):c.jsxs("button",{type:"button","data-testid":"mobile-settings-demo",onClick:a,className:"flex w-full items-center gap-3 rounded p-2 text-left text-sm text-pri hover:bg-3",children:[c.jsx(Gl,{size:16,"aria-hidden":!0,className:"text-ter"}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:i("mobile.section.demo")})]})]})]})},XR={team:wc,tasks:e0,flows:s0,settings:Ff},ZR={team:"mobile.nav.team",tasks:"mobile.nav.tasks",flows:"mobile.nav.flows",settings:"mobile.nav.settings"},QR=({active:t,onSelect:a,sections:o,openTaskCount:i=0,workingCount:l=0})=>{const{t:u}=Se();return c.jsx("nav",{"aria-label":u("mobile.nav.aria"),className:"mobile-bottom-nav flex shrink-0 items-stretch","data-testid":"mobile-bottom-nav",style:{background:"var(--bg-0)",borderTop:"1px solid var(--border)"},children:o.map(f=>{const p=XR[f],g=u(ZR[f]),m=f===t,b=f==="tasks"&&i>0?i:f==="team"&&l>0?l:0;return c.jsxs("button",{type:"button","aria-label":g,"aria-current":m?"page":void 0,"data-testid":`mobile-nav-${f}`,"data-active":m?"true":void 0,onClick:()=>a(f),className:"mobile-bottom-nav__tab relative flex flex-1 cursor-pointer flex-col items-center justify-center gap-0.5 py-2 text-xs",style:{color:m?"var(--text-primary)":"var(--text-tertiary)"},children:[m?c.jsx("span",{"aria-hidden":!0,className:"absolute top-0 left-1/2 h-0.5 w-8 -translate-x-1/2 rounded-b",style:{background:"var(--accent)"}}):null,c.jsx(p,{size:20,"aria-hidden":!0}),c.jsx("span",{children:g}),b>0?c.jsx("span",{className:"absolute top-1 right-[calc(50%-18px)] inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-full px-1 text-[11px] font-medium tabular-nums leading-none","data-testid":`mobile-nav-${f}-badge`,style:{background:"var(--accent)",color:"#ffffff"},children:b}):null]},f)})})},JR=({workspaceSwitcher:t,actions:a,banner:o})=>c.jsxs("header",{className:"mobile-topbar flex shrink-0 flex-col","data-testid":"mobile-topbar",style:{background:"var(--bg-0)",borderBottom:"1px solid var(--border)"},children:[c.jsxs("div",{className:"flex h-12 items-center gap-2 px-3",children:[c.jsx("div",{className:"min-w-0 flex-1",children:t??c.jsx("span",{className:"font-semibold text-pri",children:"Hive"})}),c.jsx("div",{className:"flex shrink-0 items-center gap-1",children:a})]}),o]}),e3=()=>typeof navigator<"u"&&/iP(hone|ad|od)/.test(navigator.platform??navigator.userAgent),t3=()=>{const[t,a]=y.useState(null);return y.useEffect(()=>{if(!e3())return;const o=typeof window<"u"?window.visualViewport:null;if(!o)return;const i=()=>{const l=Math.abs(o.height-window.innerHeight)<10;a(l?null:o.height)};return i(),o.addEventListener("resize",i),()=>{o.removeEventListener("resize",i)}},[]),t},n3={team:"mobile-section-team",tasks:"mobile-section-tasks",flows:"mobile-section-flows",settings:"mobile-section-settings"},a3=({workspaceSwitcher:t,topbarActions:a,banner:o,fullBleed:i,team:l,tasks:u,flows:f,settings:p,terminalPanels:g,overlays:m,openTaskCount:b=0,workingCount:v=0,activeSection:k,onSectionChange:S})=>{const[E,w]=y.useState("team"),C=k??E,T=t3(),N=q=>{w(q),S?.(q)},A={team:l,tasks:u,flows:f,settings:p},j=["team","tasks"];f!=null&&j.push("flows"),p!=null&&j.push("settings");const O=j.includes(C)?C:"team",L=Yw()&&O==="team"&&i==null;return c.jsxs("div",{className:`mobile-shell flex h-dvh w-full max-w-[100vw] min-w-0 flex-col overflow-hidden${L?" mobile-shell--focus":""}`,"data-mobile-shell":"true","data-testid":"mobile-shell","data-focus-mode":L?"true":void 0,style:{background:"var(--bg-0)",color:"var(--text-primary)",...T!=null?{height:`${T}px`}:{}},children:[L?o:c.jsx(JR,{workspaceSwitcher:t,actions:a,banner:o}),c.jsx("main",{className:"relative min-h-0 min-w-0 flex-1 overflow-hidden",children:i??c.jsx("div",{className:O==="team"?"flex h-full min-w-0 flex-col overflow-hidden":"flex h-full min-w-0 flex-col overflow-y-auto","data-testid":n3[O],"data-mobile-section":O,children:A[O]})}),g,i!=null||L?null:c.jsx(QR,{active:O,onSelect:N,sections:j,openTaskCount:b,workingCount:v}),m]})},r3=[],o3=y.lazy(()=>Nt(()=>import("./TaskGraphDrawer-DFYARCjj.js"),[]).then(t=>({default:t.TaskGraphContent}))),s3=({tasksFile:t,workspacePath:a,workers:o,onSelectOwner:i,onAddWorkspace:l,demoMode:u=!1})=>{const{t:f}=Se(),p=o??r3,g=y.useMemo(()=>p.length?p.map(m=>m.name):void 0,[p]);return a?c.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[u?c.jsx("div",{className:"flex shrink-0 items-center justify-end px-3 py-1",children:c.jsx("span",{className:"pill pill--neutral text-xs",children:f("demo.readOnlyBadge")})}):null,c.jsx("div",{className:"min-h-0 flex-1",children:c.jsx(y.Suspense,{fallback:null,children:c.jsx(o3,{content:t.content,hasConflict:t.hasConflict,onContentChange:t.onChange,onKeepLocal:t.onKeepLocal,onReload:t.onReload,onSave:t.onSave,onToggleTaskLine:m=>{t.toggleTaskAtLine(m).catch(Pa("tasks.toggleTaskAtLine"))},onAppendTask:m=>{t.appendTask(m).catch(Pa("tasks.appendTask"))},onAppendSubtask:(m,b)=>{t.appendSubtask(m,b).catch(Pa("tasks.appendSubtask"))},onUpdateTaskText:(m,b)=>{t.updateTaskText(m,b).catch(Pa("tasks.updateTaskText"))},onDeleteTask:m=>{t.deleteTask(m).catch(Pa("tasks.deleteTask"))},workspacePath:a,...g?{knownWorkerNames:g}:{},...i?{onSelectOwner:i}:{}})})})]}):c.jsx("div",{className:"flex h-full flex-col","data-testid":"mobile-tasks-empty",children:c.jsx(li,{title:f("mobile.tasks.noWorkspaceTitle"),description:f("mobile.tasks.noWorkspaceDesc"),action:l?c.jsx("button",{type:"button",onClick:l,className:"icon-btn icon-btn--primary mt-1 flex min-h-11 items-center gap-1.5 px-4 py-2 text-xs font-medium",children:f("firstRun.addWorkspace")}):void 0})})},Qy=[{token:"var(--accent)",label:"accent"},{token:"var(--status-blue)",label:"blue"},{token:"var(--status-purple)",label:"purple"},{token:"var(--status-orange)",label:"orange"},{token:"var(--status-green)",label:"green"},{token:"var(--status-gold)",label:"gold"}],i3=t=>{let a=0;for(let i=0;i<t.length;i+=1)a=a*31+t.charCodeAt(i)|0;const o=Math.abs(a)%Qy.length;return Qy[o]},l3=t=>{const a=t.trim();if(a.length===0)return"?";const o=a.codePointAt(0);return o===void 0?"?":String.fromCodePoint(o).toUpperCase()},nm=({workspaceId:t,name:a,isActive:o,working:i,workingCount:l,size:u=32})=>{const{token:f,label:p}=i3(t),g=l3(a),m=l&&l>1?l:null;return c.jsx(rx,{size:u,color:f,fontRatio:.45,ringColor:o?f:null,testId:"workspace-avatar",data:{"workspace-id":t,active:o?"true":void 0,"color-label":p},decoration:m!==null?c.jsx("span",{className:"absolute flex h-[16px] min-w-[16px] items-center justify-center rounded-full px-1 font-medium text-xs tabular-nums leading-none",style:{right:"-4px",bottom:"-4px",background:"var(--status-green)",color:"#0a1f0a",boxShadow:"0 0 0 2px var(--bg-1)"},"data-testid":"workspace-avatar-working-count","aria-hidden":!0,children:m>9?"9+":m}):i?c.jsx("span",{className:"status-dot status-dot--working absolute",style:{right:"-2px",bottom:"-2px",boxShadow:"0 0 0 2px var(--bg-1)"},"aria-hidden":!0}):null,children:g})},Jy=(t,a)=>{if(!t||t.length===0)return a("sidebar.noMembers");const o=t.filter(i=>i.status==="working").length;return o>0?a("sidebar.workingCount",{working:o,total:t.length}):a("sidebar.teamMemberCount",{count:t.length})},c3=({activeWorkspaceId:t,workspaces:a,workersByWorkspaceId:o,createDisabledReason:i,onSelectWorkspace:l,onCreateClick:u,onDeleteWorkspace:f})=>{const{t:p}=Se(),g=tn(),[m,b]=y.useState(!1),[v,k]=y.useState(null),[S,E]=y.useState(!1),w=a?.find(T=>T.id===t)?.name??p("mobile.section.workspaces"),C=()=>{if(!v||S)return;const T=v;E(!0),Promise.resolve(f(T)).then(()=>{g.show({kind:"success",message:p("sidebar.removed",{name:T.name})})}).catch(N=>{const A=N instanceof Error?N.message:String(N);g.show({kind:"error",message:p("sidebar.deleteFailed",{message:A})})}).finally(()=>{E(!1),k(null)})};return c.jsxs(Oo,{open:m,onOpenChange:b,children:[c.jsx(HT,{asChild:!0,children:c.jsxs("button",{type:"button","data-testid":"mobile-workspace-switcher-trigger","aria-label":p("mobile.workspaces.switch"),className:"mobile-ws-switcher flex min-h-11 w-full items-center gap-1.5 rounded-md px-2 py-1.5 text-left hover:bg-2",children:[c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-pri",children:w}),c.jsx(_o,{size:16,"aria-hidden":!0,className:"shrink-0 text-ter"})]})}),c.jsxs(Do,{children:[c.jsx(Mo,{"data-testid":"mobile-workspace-switcher-overlay",className:"app-overlay fixed inset-0 z-40"}),c.jsx("div",{className:"pointer-events-none fixed inset-0 z-50 grid items-end",children:c.jsxs(Lo,{"data-testid":"mobile-workspace-switcher-sheet",className:"dialog-slide-up elev-2 pointer-events-auto flex max-h-[70dvh] w-full flex-col overflow-hidden rounded-t-xl border-t",style:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},children:[c.jsx(zo,{asChild:!0,children:c.jsxs("div",{className:"flex shrink-0 items-baseline gap-2 border-b px-4 py-3",style:{borderColor:"var(--border)"},children:[c.jsx("span",{className:"text-base font-semibold text-pri",children:p("sidebar.workspaces")}),a&&a.length>0?c.jsx("span",{className:"text-xs text-ter tabular-nums",children:a.length}):null]})}),c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto py-1",children:!a||a.length===0?c.jsxs("div",{className:"flex flex-col items-center gap-1 px-6 py-8 text-center",children:[c.jsx("span",{className:"text-sm font-medium text-sec",children:p("sidebar.noWorkspaces")}),c.jsx("span",{className:"text-xs text-ter",children:i??p("sidebar.noWorkspacesDesc")})]}):a.map(T=>{const N=T.id===t,A=o[T.id],j=A?.filter(O=>O.status==="working").length??0;return c.jsxs("div",{className:"flex items-center gap-1 pr-2",children:[c.jsxs("button",{type:"button","data-testid":`mobile-ws-row-${T.id}`,onClick:()=>{b(!1),l(T.id)},className:"flex min-h-14 min-w-0 flex-1 items-center gap-3 px-4 py-2 text-left",style:N?{background:"color-mix(in oklab, var(--accent) 10%, transparent)"}:void 0,children:[c.jsx(nm,{workspaceId:T.id,name:T.name,isActive:N,working:j>0,workingCount:j,size:36}),c.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[c.jsx("span",{className:"truncate text-sm font-medium text-pri",children:T.name}),c.jsx("span",{className:"truncate text-xs text-ter",children:Jy(A,p)})]}),N?c.jsx(Ja,{size:18,className:"shrink-0 text-accent","aria-hidden":!0}):null]}),c.jsx("button",{type:"button","aria-label":p("sidebar.deleteAria",{name:T.name}),"data-testid":`mobile-ws-delete-${T.id}`,onClick:()=>k(T),className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md text-ter",children:c.jsx(bc,{size:16,"aria-hidden":!0})})]},T.id)})}),c.jsx("div",{className:"shrink-0 border-t px-4 pt-3 pb-[max(12px,env(safe-area-inset-bottom))]",style:{borderColor:"var(--border)",background:"var(--bg-2)"},children:c.jsxs("button",{type:"button",disabled:!!i,title:i,"data-testid":"mobile-ws-create",onClick:()=>{b(!1),u()},className:"icon-btn icon-btn--primary flex w-full min-h-11 items-center justify-center gap-1.5",children:[c.jsx(Xl,{size:16,"aria-hidden":!0}),p("sidebar.newWorkspace")]})})]})})]}),c.jsx(ci,{open:v!==null,onOpenChange:T=>{!T&&!S&&k(null)},title:v?p("sidebar.deleteConfirm",{name:v.name}):p("sidebar.deleteLabel"),description:v?p("sidebar.deleteDescription",{path:v.path,summary:Jy(o[v.id],p)}):"",confirmLabel:p(S?"sidebar.deleting":"sidebar.deleteLabel"),confirmKind:"danger",onConfirm:C})]})},u3=4e3,d3=t=>{const[a,o]=y.useState([]);return y.useEffect(()=>{if(!t){o([]);return}let i=!1;const l=()=>{tw().then(f=>{i||o(f)}).catch(()=>{})};l();const u=window.setInterval(l,u3);return()=>{i=!0,window.clearInterval(u)}},[t]),a},f3=({devices:t,enabled:a})=>{const{notify:o}=Rc(),{t:i}=Se(),l=y.useRef(null);return y.useEffect(()=>{if(!a){l.current=null;return}const u=new Map(t.filter(p=>!p.revoked).map(p=>[p.deviceId,p])),f=l.current;if(l.current=new Set(u.keys()),!!f)for(const[p,g]of u)f.has(p)||o({brief:i("notifications.remoteSession.brief",{name:g.name}),detail:i("notifications.remoteSession.detail",{name:g.name}),kind:"success",title:i("notifications.remoteSession.title")})},[t,a,o,i]),null},m3=()=>{const{status:t}=$m(),a=t.enabled&&t.loggedIn,o=d3(a);return c.jsx(f3,{devices:o,enabled:a})};let am=!1;const wx=()=>{am=!0,window.location.reload()},p3=t=>{y.useEffect(()=>{const a=o=>{if(am){am=!1;return}o.preventDefault(),o.returnValue=""};return window.addEventListener("beforeunload",a),()=>window.removeEventListener("beforeunload",a)},[t])},h3=3e3,g3=({onTryDemo:t}={})=>{const{t:a}=Se(),[o,i]=y.useState(!1),l=y.useRef(!0),u=y.useCallback(()=>{typeof window>"u"||wx()},[]),f=y.useCallback(async()=>{try{return(await fetch("/api/version",{credentials:"include"})).ok}catch{return!1}},[]);y.useEffect(()=>{l.current=!0;const g=window.setInterval(async()=>{l.current&&await f()&&u()},h3);return()=>{l.current=!1,window.clearInterval(g)}},[f,u]);const p=async()=>{i(!0);try{if(await f()){u();return}}finally{window.setTimeout(()=>{l.current&&i(!1)},400)}};return c.jsx("div",{className:"flex flex-1 items-center justify-center p-8","data-testid":"runtime-offline-page",children:c.jsxs("div",{className:"elev-1 flex max-w-md flex-col items-center gap-3 rounded border p-6 text-center",style:{background:"var(--bg-elevated)",borderColor:"var(--border)"},children:[c.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full",style:{background:"var(--bg-3)",color:"var(--status-orange)"},children:c.jsx(jE,{size:24,"aria-hidden":!0})}),c.jsx("div",{className:"font-semibold text-pri",children:a("pwa.runtimeOffline.title")}),c.jsx("div",{className:"text-sec text-sm leading-relaxed",children:a("pwa.runtimeOffline.body")}),c.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-center gap-2",children:[c.jsxs("button",{type:"button",className:"icon-btn icon-btn--primary flex items-center gap-2","data-testid":"runtime-offline-retry",disabled:o,onClick:()=>{p()},children:[o?c.jsx(Va,{size:12,className:"animate-spin","aria-hidden":!0}):c.jsx(Cm,{size:12,"aria-hidden":!0}),a(o?"pwa.runtimeOffline.retrying":"pwa.runtimeOffline.retry")]}),t?c.jsxs("button",{type:"button",className:"icon-btn flex items-center gap-2","data-testid":"runtime-offline-try-demo",onClick:t,children:[c.jsx(MS,{size:12,"aria-hidden":!0}),a("pwa.runtimeOffline.tryDemo")]}):null]}),c.jsx("div",{className:"text-ter text-xs",children:a("pwa.runtimeOffline.autoReconnect")})]})})},rm=new Set;let xx=null;const v3=t=>{xx=t;for(const a of rm)a(t)},y3=t=>(rm.add(t),t(xx),()=>{rm.delete(t)}),b3=2e3,w3=async t=>{if(!t.serviceWorker)return;let a;try{a=await t.serviceWorker.register("/sw.js")}catch{return}const o=l=>{const u=()=>{l.state==="installed"&&t.serviceWorker?.controller&&v3(()=>{l.postMessage({type:"SKIP_WAITING"}),setTimeout(t.reload,b3)})};l.addEventListener("statechange",u)};a.waiting&&t.serviceWorker.controller&&o(a.waiting),a.installing&&o(a.installing),a.addEventListener("updatefound",()=>{a.installing&&o(a.installing)});let i=!1;t.serviceWorker.addEventListener("controllerchange",()=>{i||(i=!0,t.reload())})},x3=()=>typeof navigator>"u"||typeof window>"u"?Promise.resolve():w3({isProd:!0,serviceWorker:"serviceWorker"in navigator?navigator.serviceWorker:null,reload:wx}),eb=({terminalRuns:t})=>{const{t:a}=Se(),o=xt(),[i,l]=y.useState(null),[u,f]=y.useState(!1);if(y.useEffect(()=>y3(b=>{l(()=>b)}),[]),!i)return null;const p=t.every(b=>b.status==="stopped"),g=!p||u,m=a(u?"pwa.reloading":p?"pwa.reloadToActivate":"pwa.waitForAgents");return c.jsxs("div",{className:"update-toast elev-2 fixed right-4 bottom-8 z-50 flex items-center gap-3 rounded border px-3 py-2",style:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},"data-mobile":o||void 0,"data-testid":"update-available-toast",role:"status","aria-live":"polite",children:[c.jsx(Cm,{size:14,className:"text-sec","aria-hidden":!0}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"font-medium text-pri text-xs",children:a("pwa.appShellUpdated")}),c.jsx("span",{className:"text-ter text-xs",children:a(p?"pwa.reloadToActivate":"pwa.waitForAgents")})]}),c.jsx("button",{type:"button",className:"icon-btn icon-btn--primary","data-testid":"update-available-reload",disabled:g,onClick:()=>{f(!0),i()},children:m})]})},k3=new Set(["add-workspace","try-demo"]),S3=t=>t!==null&&k3.has(t),E3=({onAddWorkspace:t,onTryDemo:a,ready:o})=>{const i=y.useRef(!1);y.useEffect(()=>{if(!o||i.current||typeof window>"u")return;const u=new URLSearchParams(window.location.search).get("action");S3(u)&&(i.current=!0,window.history.replaceState({},"",window.location.pathname),u==="add-workspace"?t():u==="try-demo"&&a())},[o,t,a])},tb=()=>{const{t}=Se(),a=tn(),o=xt(),{pending:i,refresh:l}=$m(),[u,f]=y.useState(!1),p=y.useRef(!1),g=i?.deviceName??"",m=i?.pairingId??null,b=i?.expiresAt??null;y.useEffect(()=>{m!==null&&(p.current=!1)},[m]);const v=y.useCallback(async()=>{if(!(!m||u||p.current)){p.current=!0,f(!0);try{await RN(m),a.show({kind:"success",message:t("remote.confirm.paired",{name:g})})}catch{p.current=!1,a.show({kind:"error",message:t("remote.confirm.failed")})}finally{f(!1),await l()}}},[m,u,g,l,t,a]),k=y.useCallback(async S=>{if(!(!m||p.current)){p.current=!0;try{await ON(m)}catch{}a.show({kind:S==="expired"?"warning":"success",message:t(S==="expired"?"remote.confirm.expired":"remote.confirm.rejected")}),f(!1),await l()}},[m,l,t,a]);return y.useEffect(()=>{if(b===null)return;const S=b-Date.now();if(S<=0){k("expired");return}const E=window.setTimeout(()=>{k("expired")},S);return()=>window.clearTimeout(E)},[b,k]),!i||o?null:c.jsx(Oo,{open:!0,onOpenChange:S=>{S||k("rejected")},children:c.jsxs(Do,{children:[c.jsx(Mo,{"data-testid":"remote-pairing-confirm-overlay",className:"app-overlay fixed inset-0 z-[80]"}),c.jsx("div",{className:"pointer-events-none fixed inset-0 z-[90] grid place-items-center p-4",children:c.jsxs(Lo,{"data-testid":"remote-pairing-confirm",className:"dialog-scale-pop elev-2 pointer-events-auto w-[440px] max-w-[calc(100vw-32px)] rounded-lg border p-5",style:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},children:[c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("div",{"aria-hidden":!0,className:"flex h-9 w-9 shrink-0 items-center justify-center rounded",style:{background:"color-mix(in oklab, var(--accent) 14%, transparent)",color:"var(--accent)",border:"1px solid color-mix(in oklab, var(--accent) 30%, transparent)"},children:c.jsx(RE,{size:18})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx(zo,{className:"text-lg font-semibold text-pri",children:t("remote.confirm.title")}),c.jsx(oi,{className:"mt-1.5 text-sm text-sec",children:t("remote.confirm.description",{name:g})})]})]}),c.jsxs("div",{className:"mt-4",children:[c.jsx("div",{className:"mb-1 text-xs font-medium uppercase tracking-wider text-ter",children:t("remote.confirm.sasLabel")}),c.jsx("div",{"data-testid":"remote-pairing-sas",className:"rounded border bg-2 py-3 text-center font-mono text-3xl tracking-[0.4em] text-pri",style:{borderColor:"var(--border)"},children:i.sas}),c.jsx("p",{className:"mt-2 text-xs text-ter",children:t("remote.confirm.warning")})]}),c.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[c.jsx("button",{type:"button","data-testid":"remote-pairing-reject",onClick:()=>{k("rejected")},disabled:u,className:"icon-btn",children:t("remote.confirm.reject")}),c.jsx("button",{type:"button","data-testid":"remote-pairing-confirm-action",onClick:()=>{v()},disabled:u,className:"icon-btn icon-btn--primary",children:t(u?"remote.confirm.confirming":"remote.confirm.confirm")})]})]})})]})})},C3=t=>!!t?.some(a=>a.status==="working"),T3=t=>t?.filter(a=>a.status==="working").length??0,N3=(t,a)=>{if(!t||t.length===0)return a("sidebar.noMembers");const o=t.filter(i=>i.status==="working").length;return o>0?a("sidebar.workingCount",{working:o,total:t.length}):a("sidebar.teamMemberCount",{count:t.length})},kx="hive.sidebar.githubDismissed",j3="https://www.bilibili.com/video/BV1UHLp6nEQR",_3=()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(kx)==="1"}catch{return!1}},A3=({activeWorkspaceId:t,collapsed:a=!1,createDisabledReason:o,onCreateClick:i,onDeleteWorkspace:l,onSelectWorkspace:u,onToggleCollapse:f,workersByWorkspaceId:p,workspaces:g})=>{const{t:m}=Se(),[b,v]=y.useState(null),[k,S]=y.useState(!1),[E,w]=y.useState(_3),C=tn(),T=()=>{w(!0);try{window.localStorage.setItem(kx,"1")}catch{}},N=!!o,A=D=>{v(D)},j=()=>{if(!b||k)return;const D=b;S(!0),Promise.resolve(l(D)).then(()=>{C.show({kind:"success",message:m("sidebar.removed",{name:D.name})})}).catch(L=>{const q=L instanceof Error?L.message:String(L);C.show({kind:"error",message:m("sidebar.deleteFailed",{message:q})})}).finally(()=>{S(!1),v(null)})},O=c.jsx(ci,{open:b!==null,onOpenChange:D=>{!D&&!k&&v(null)},title:b?m("sidebar.deleteConfirm",{name:b.name}):m("sidebar.deleteLabel"),description:b?m("sidebar.deleteDescription",{path:b.path,summary:N3(p[b.id],m)}):"",confirmLabel:m(k?"sidebar.deleting":"sidebar.deleteLabel"),confirmKind:"danger",onConfirm:j});return c.jsxs("nav",{"aria-label":"Workspaces",className:"flex h-full flex-col",children:[c.jsxs("div",{className:"ws-sidebar-header flex items-center justify-between gap-2 px-3 pt-3 pb-2",style:{boxShadow:"inset 0 -1px 0 var(--border)"},children:[c.jsxs("div",{className:"ws-sidebar-title flex min-w-0 items-center gap-2",children:[c.jsx("span",{className:"ws-sidebar-title__text text-xs font-medium text-ter","data-testid":"workspace-sidebar-title",children:m("sidebar.workspaces")}),g&&g.length>0?c.jsx("span",{className:"ws-sidebar-count mono rounded bg-2 px-1.5 py-0.5 text-xs text-ter",children:g.length}):null]}),f?c.jsx(et,{side:"right",label:m(a?"layout.sidebarExpand":"layout.sidebarCollapse"),children:c.jsx("button",{type:"button","aria-label":m(a?"layout.sidebarExpand":"layout.sidebarCollapse"),"aria-expanded":!a,"data-testid":"workspace-sidebar-toggle",onClick:f,className:"ws-collapse-toggle",children:a?c.jsx(RS,{size:16,"aria-hidden":!0}):c.jsx(_S,{size:16,"aria-hidden":!0})})}):null]}),g===null?c.jsx("p",{className:"px-3 py-2 text-xs text-ter",children:m("common.loading")}):g.length===0?c.jsx("div",{className:"ws-empty flex-1 px-2 py-4",children:c.jsx("div",{className:"ws-empty__wide",children:c.jsx(li,{title:m("sidebar.noWorkspaces"),description:o??m("sidebar.noWorkspacesDesc"),icon:c.jsx(Qb,{size:20}),action:c.jsxs("button",{type:"button",onClick:N?void 0:i,disabled:N,"aria-label":m("sidebar.newWorkspace"),title:o??m("sidebar.newWorkspace"),className:"icon-btn icon-btn--primary mt-1 flex items-center gap-1.5 px-4 py-2 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50",children:[c.jsx(Xl,{size:14,"aria-hidden":!0}),m("sidebar.newWorkspace")]})})})}):c.jsxs("ul",{className:"flex-1 scroll-y pb-2",children:[g.map(D=>{const L=p[D.id],q=D.id===t,$=C3(L),ae=T3(L);return c.jsxs("li",{className:"group relative",children:[c.jsx(et,{side:"right",label:c.jsxs("span",{className:"flex flex-col gap-0.5",children:[c.jsx("span",{className:"font-medium",children:D.name}),c.jsx("span",{className:"mono text-ter",children:D.path})]}),children:c.jsxs("button",{type:"button","aria-label":D.name,"aria-current":q?"true":void 0,"data-workspace-path":D.path,onClick:()=>u(D.id),className:`ws-row flex w-full items-center gap-2.5 py-1.5 pr-7 pl-2 text-left pointer-coarse:min-h-11${q?" active":""}`,children:[c.jsx(nm,{workspaceId:D.id,name:D.name,isActive:!1,working:$,workingCount:ae}),c.jsx("span",{className:`min-w-0 flex-1 truncate text-sm ${q?"font-medium text-pri":"text-pri"}`,children:D.name})]})}),c.jsx(et,{side:"right",label:c.jsxs("span",{className:"flex flex-col gap-0.5",children:[c.jsx("span",{className:"font-medium",children:D.name}),c.jsx("span",{className:"mono text-ter",children:D.path})]}),children:c.jsx("button",{type:"button","aria-label":D.name,"aria-current":q?"true":void 0,onClick:()=>u(D.id),className:"ws-avatar-cell hidden w-full justify-center py-2","data-testid":"ws-avatar-cell",children:c.jsx(nm,{workspaceId:D.id,name:D.name,isActive:q,working:$,workingCount:ae})})}),c.jsx(et,{label:m("sidebar.deleteAria",{name:D.name}),children:c.jsx("button",{type:"button","aria-label":m("sidebar.deleteAria",{name:D.name}),onClick:()=>A(D),className:"ws-row-delete absolute top-2 right-2 flex h-6 w-6 items-center justify-center rounded text-ter opacity-0 transition-colors pointer-coarse:h-10 pointer-coarse:w-10 hover:text-status-red focus:opacity-100 group-hover:opacity-100",children:c.jsx(bc,{size:14,"aria-hidden":!0})})})]},D.id)}),c.jsx("li",{children:c.jsx(et,{label:o??m("sidebar.newWorkspace"),children:c.jsxs("button",{type:"button",onClick:N?void 0:i,disabled:N,"aria-label":m("sidebar.newWorkspace"),title:o??void 0,className:"ws-add ws-add--inline flex items-center justify-center gap-1.5 rounded border border-dashed px-3 py-2 text-xs font-medium text-sec transition-colors disabled:cursor-not-allowed disabled:opacity-50",style:{borderColor:"var(--border-bright)"},children:[c.jsx(Xl,{size:14,"aria-hidden":!0}),c.jsx("span",{className:"ws-add__label",children:m("sidebar.newWorkspace")})]})})})]}),E?null:c.jsxs("div",{className:"ws-sidebar-footer group relative",children:[c.jsxs("a",{href:j3,target:"_blank",rel:"noopener noreferrer","aria-label":m("sidebar.openDemoVideo"),title:m("sidebar.openDemoVideo"),className:"ws-sidebar-footer__link flex items-center gap-2.5 px-3 py-3 text-sm text-ter transition-colors hover:text-pri",children:[c.jsx("img",{src:"/bilibili.ico",alt:"","aria-hidden":"true",className:"h-[18px] w-[18px] rounded-[4px] object-cover",draggable:!1}),c.jsx("span",{className:"ws-sidebar-footer__label",children:m("sidebar.demoVideo")})]}),c.jsxs("a",{href:"https://github.com/tt-a1i/hive",target:"_blank",rel:"noopener noreferrer","aria-label":m("sidebar.openRepository"),title:m("sidebar.openRepository"),className:"ws-sidebar-footer__link flex items-center gap-2.5 px-3 py-3 text-sm text-ter transition-colors hover:text-pri",children:[c.jsx("svg",{width:"18",height:"18",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:c.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})}),c.jsx("span",{className:"ws-sidebar-footer__label",children:"GitHub"})]}),c.jsx("button",{type:"button","aria-label":m("sidebar.dismissRepository"),title:m("sidebar.dismissRepository"),onClick:T,className:"ws-sidebar-footer__dismiss absolute top-1.5 right-1.5 flex h-4 w-4 items-center justify-center rounded text-ter opacity-0 transition-opacity pointer-coarse:h-8 pointer-coarse:w-8 hover:bg-3 hover:text-pri focus:opacity-100 group-hover:opacity-100",children:c.jsx(Ga,{size:10,"aria-hidden":!0})})]}),O]})},Un=/^(\s*)-\s+\[( |x|X)\]\s+(.*)$/,R3=/(?:^|[\s\p{P}])(@[A-Za-z0-9_-]+)/gu,O3=t=>{const a=[];for(const o of t.matchAll(R3))o[1]&&a.push(o[1]);return a},D3=t=>{const a=new Map;for(const o of t){const i=o.trim();i&&a.set(i.toLowerCase(),i)}return a},WM=(t,a={})=>{const o=[],i=[],l=t.split(/\r?\n/),u=a.knownWorkerNames?D3(a.knownWorkerNames):null;for(let f=0;f<l.length;f++){const p=l[f];if(!p)continue;const g=p.match(Un);if(!g)continue;const[,m="",b=" ",v=""]=g,k=m.replace(/\t/g," ").length,S=O3(v);let E;if(u){E=[];for(const N of S){const A=u.get(N.slice(1).toLowerCase());A&&E.push(`@${A}`)}}else E=S;let w=v;for(const N of E){const A=N.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");w=w.replace(new RegExp(`(?:^|(?<=\\s|\\p{P}))${A}(?!\\w)`,"u"),"")}w=w.replace(/\s+/g," ").trim();const C={checked:b.toLowerCase()==="x",children:[],indent:k,line:f,mentions:E,text:w};for(;i.length>0;){const N=i[i.length-1];if(N&&N.indent<k)break;i.pop()}const T=i[i.length-1];T?T.children.push(C):o.push(C),i.push(C)}return o},M3=t=>{let a=0;const o=[],i=t.split(/\r?\n/);for(const l of i){if(!l)continue;const u=l.match(Un);if(!u)continue;const[,f="",p=" "]=u,g=f.replace(/\t/g," ").length;for(;o.length>0;){const m=o[o.length-1];if(m&&m.indent<g)break;o.pop()}!o[o.length-1]&&p.toLowerCase()!=="x"&&(a+=1),o.push({indent:g})}return a},IM=t=>{if(t.children.length===0)return null;let a=0;for(const o of t.children)o.checked&&(a+=1);return{done:a,total:t.children.length}},ui=t=>t.includes(`\r
|
|
81
|
-
`)?`\r
|
|
82
|
-
`:`
|
|
83
|
-
`,L3=(t,a)=>{const o=ui(t),i=t.length>0&&!t.endsWith(`
|
|
84
|
-
`);return`${t}${i?o:""}- [ ] ${a}${o}`},z3=(t,a)=>{const o=t.split(/\r?\n/),i=o[a];if(i===void 0)return t;const l=i.match(Un);if(!l)return t;const u=(l[2]??" ").toLowerCase()==="x",f=i.replace(Un,(p,g,m,b)=>`${g}- [${u?" ":"x"}] ${b}`);return o[a]=f,o.join(ui(t))},Sx=t=>t.replace(/\r?\n/g," ").replace(/\s+/g," ").trim(),H3=(t,a,o)=>{const i=t.split(/\r?\n/),l=i[a];if(l===void 0||!l.match(Un))return t;const f=Sx(o);if(!f)return t;const p=l.replace(Un,(g,m,b)=>`${m}- [${b}] ${f}`);return i[a]=p,i.join(ui(t))},B3=(t,a)=>{const o=t.split(/\r?\n/),i=o[a];if(i===void 0)return t;const l=i.match(Un);if(!l)return t;const u=(l[1]??"").replace(/\t/g," ").length;let f=a+1;for(;f<o.length;){const p=o[f];if(p===void 0)break;const g=p.match(Un);if(!g||(g[1]??"").replace(/\t/g," ").length<=u)break;f+=1}return o.splice(a,f-a),o.join(ui(t))},U3=(t,a,o)=>{const i=Sx(o);if(!i)return t;const l=t.split(/\r?\n/),u=l[a];if(u===void 0)return t;const f=u.match(Un);if(!f)return t;const p=f[1]??"",g=p.replace(/\t/g," ").length;let m=a+1;for(;m<l.length;){const v=l[m];if(v===void 0)break;const k=v.match(Un);if(!k||(k[1]??"").replace(/\t/g," ").length<=g)break;m+=1}const b=`${p} `;return l.splice(m,0,`${b}- [ ] ${i}`),l.join(ui(t))},W3=(t,a,o)=>t===a||t===o,I3=(t,a)=>{const[o,i]=y.useState(""),[l,u]=y.useState(!1),[f,p]=y.useState(!1),[g,m]=y.useState(null),b=y.useRef(!1),v=y.useRef(""),k=y.useRef(""),S=y.useCallback((w,C)=>{if(!b.current){v.current=w,k.current=w,i(w),p(!1),m(null);return}W3(w,v.current,C)||(m(w),p(!0))},[]);if(y.useEffect(()=>{if(!t){i(""),u(!1),p(!1),m(null),b.current=!1,v.current="",k.current="";return}let w=!1;return i(""),u(!1),p(!1),m(null),b.current=!1,v.current="",k.current="",gN(t).then(({content:C})=>{w||(v.current=C,b.current=!1,k.current=C,i(C),u(!0),p(!1),m(null))}).catch(C=>{w||(v.current="",b.current=!1,k.current="",i(""),u(!0),p(!1),console.error("[hive] swallowed:tasks.initialLoad",C),m(null))}),()=>{w=!0}},[t]),y.useEffect(()=>{if(!t)return;let w=!1,C=null,T=0,N=null;const A=()=>{if(w)return;const j=F0().openWebSocket(`/ws/tasks/${t}`);N=j,j.onmessage=O=>{if(w)return;const D=JSON.parse(String(O.data));D.type!=="tasks-snapshot"&&D.type!=="tasks-updated"||typeof D.content=="string"&&(T=0,S(D.content,k.current))},j.onclose=()=>{if(w)return;T+=1;const O=Math.min(3e4,500*2**(T-1));C=setTimeout(A,O)}};return A(),()=>{w=!0,C!==null&&(clearTimeout(C),C=null),N?.close()}},[S,t]),a!==void 0)return{content:a,hasConflict:!1,loaded:!0,onChange:w=>{},onKeepLocal:()=>{},onReload:()=>{},onSave:async()=>{},toggleTaskAtLine:async w=>{},appendTask:async w=>{},appendSubtask:async(w,C)=>{},updateTaskText:async(w,C)=>{},deleteTask:async w=>{}};const E=async(w,C)=>{if(!t)return;const T=k.current,N=w(T);if(N!==T){v.current=N,k.current=N,b.current=!1,i(N);try{const A=await Dl(t,{content:N});v.current=A.content,k.current=A.content,i(A.content)}catch(A){throw v.current=T,k.current=T,i(T),console.error(`[hive] swallowed:tasks.${C}`,A),A}}};return{content:o,hasConflict:f,loaded:l,onChange:w=>{b.current=w!==v.current,k.current=w,i(w)},onKeepLocal:()=>{p(!1),m(null)},onReload:()=>{const w=g??v.current;v.current=w,b.current=!1,k.current=w,i(w),p(!1),m(null)},onSave:async()=>{if(!t)return;const w=await Dl(t,{content:o});v.current=w.content,b.current=!1,k.current=w.content,i(w.content),p(!1),m(null)},toggleTaskAtLine:async w=>{if(!t)return;const C=k.current,T=z3(C,w);if(T!==C){v.current=T,k.current=T,b.current=!1,i(T);try{const N=await Dl(t,{content:T});v.current=N.content,k.current=N.content,i(N.content)}catch(N){throw v.current=C,k.current=C,i(C),N}}},appendTask:async w=>{const C=w.trim();if(!t||!C)return;const T=k.current,N=L3(T,C);v.current=N,k.current=N,b.current=!1,i(N);try{const A=await Dl(t,{content:N});v.current=A.content,k.current=A.content,i(A.content)}catch(A){throw v.current=T,k.current=T,i(T),A}},appendSubtask:async(w,C)=>{const T=C.trim();T&&await E(N=>U3(N,w,T),"appendSubtask")},updateTaskText:async(w,C)=>{const T=C.trim();T&&await E(N=>H3(N,w,T),"updateTaskText")},deleteTask:async w=>{await E(C=>B3(C,w),"deleteTask")}}},Ex=(t,a,o)=>{const i=new Set(t.map(u=>u.run_id)),l=new Set(t.map(u=>u.agent_id));return[...t,...a.filter(u=>i.has(u.run_id)?!1:o&&Gs(u,o)?!0:!l.has(u.agent_id))]},q3=(t,a,o=[])=>{const[i,l]=y.useState({}),u=y.useCallback((m,b)=>{l(v=>({...v,[m]:(v[m]??[]).filter(k=>k.agent_id!==b)}))},[]),f=y.useCallback((m,b)=>{l(v=>({...v,[m]:(v[m]??[]).filter(k=>k.run_id!==b)}))},[]);y.useEffect(()=>{if(!t)return;const m=new Set(a.map(k=>k.run_id)),b=new Set(a.map(k=>k.agent_id)),v=new Set(o.filter(k=>k.status==="stopped").map(k=>k.id));l(k=>{const S=k[t]??[],E=S.filter(w=>m.has(w.run_id)?!1:Gs(w,t)?!0:b.has(w.agent_id)?!1:!v.has(w.agent_id));return E.length===S.length?k:{...k,[t]:E}})},[a,o,t]);const p=y.useCallback(({agentId:m,agentName:b,runId:v,status:k="starting",terminalInputProfile:S="default",workspaceId:E})=>{const w={agent_id:m,agent_name:b,run_id:v,status:k,terminal_input_profile:S};l(C=>{const T=Gs(w,E),N=(C[E]??[]).filter(A=>A.run_id===w.run_id?!1:T?!0:A.agent_id!==w.agent_id);return{...C,[E]:[...N,w]}})},[]),g=y.useMemo(()=>Ex(a,t?i[t]??[]:[],t),[a,i,t]);return{forgetOptimisticAgent:u,forgetOptimisticRun:f,optimisticRunsByWorkspaceId:i,recordOptimisticRun:p,terminalRuns:g}};let Cx=null;const om=new Set,P3=t=>{Cx=t;for(const a of om)a()},F3=t=>(om.add(t),()=>om.delete(t)),K3=()=>Cx,Tx="hive.package-update.dismissed-version",Y3=()=>{try{return window.localStorage.getItem(Tx)}catch{return null}},$3=t=>{try{window.localStorage.setItem(Tx,t)}catch{}},nb=({currentVersion:t=Vm,versionInfo:a})=>{const{t:o}=Se(),i=xt(),[l,u]=y.useState(Y3),[f,p]=y.useState("idle"),g=a?.updateAvailable&&a.latestVersion!==t?a:null;if(!g||l===g.latestVersion)return null;const m=!!g.installHint,b=o(f==="copied"?"packageUpdate.commandCopied":f==="error"?"packageUpdate.commandCopyFailed":"packageUpdate.copyCommand"),v=()=>{$3(g.latestVersion),u(g.latestVersion)},k=async()=>{if(g.installHint)try{await navigator.clipboard.writeText(g.installHint),p("copied"),window.setTimeout(()=>p("idle"),1600)}catch{p("error"),window.setTimeout(()=>p("idle"),2200)}};return c.jsxs("div",{className:"package-update-toast elev-2 toast-pop fixed right-4 bottom-24 z-50 flex w-[min(420px,calc(100vw-2rem))] items-start gap-3 rounded border px-3 py-2.5",style:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},"data-mobile":i||void 0,"data-testid":"package-update-toast",role:"status","aria-live":"polite",children:[c.jsx("div",{className:"mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded border",style:{background:"color-mix(in oklab, var(--accent) 10%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 28%, transparent)",color:"var(--accent)"},"aria-hidden":!0,children:c.jsx(gE,{size:15})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"font-medium text-pri text-xs",children:o("packageUpdate.title",{version:g.latestVersion})}),c.jsx("div",{className:"mt-0.5 text-ter text-xs",children:o("packageUpdate.body",{current:t,latest:g.latestVersion})}),m?c.jsx("code",{className:"mono mt-2 block truncate rounded border px-2 py-1 text-ter text-xs",title:g.updateNote||g.installHint,style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:g.installHint}):g.updateNote?c.jsx("div",{className:"mt-2 text-ter text-xs",children:g.updateNote}):null,c.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[m?c.jsxs("button",{type:"button",className:"icon-btn icon-btn--primary","data-testid":"package-update-copy-command",onClick:k,"aria-label":b,title:b,children:[f==="copied"?c.jsx(Ja,{size:13}):c.jsx(Nr,{size:13}),c.jsx("span",{children:b})]}):null,g.releaseUrl?c.jsxs("a",{href:g.releaseUrl,target:"_blank",rel:"noopener noreferrer",className:"icon-btn","data-testid":"package-update-open-release","aria-label":o("packageUpdate.openRelease"),title:o("packageUpdate.openRelease"),children:[c.jsx(Em,{size:13}),c.jsx("span",{children:o("packageUpdate.release")})]}):null,c.jsx("button",{type:"button",className:"icon-btn","data-testid":"package-update-dismiss",onClick:v,children:o("packageUpdate.later")})]})]}),c.jsx(et,{label:o("common.dismiss"),children:c.jsx("button",{type:"button",className:"flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded text-ter transition-colors hover:bg-3 hover:text-pri focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)]","data-testid":"package-update-close",onClick:v,"aria-label":o("common.dismiss"),children:c.jsx(Ga,{size:13})})})]})},V3=(t=typeof window<"u"?window.matchMedia.bind(window):void 0,a=typeof navigator<"u"?navigator.standalone:void 0)=>t?.("(display-mode: standalone)").matches?!0:a===!0,G3=t=>{if(!t||!(t instanceof HTMLElement))return!1;const a=t.tagName.toLowerCase();return!!(a==="input"||a==="textarea"||a==="select"||t.isContentEditable||t.closest(".xterm"))},X3=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),Z3=(t,a)=>a?t.metaKey:t.ctrlKey,Q3=(t,a,o=X3)=>!(t.key.toLowerCase()!==a.key||(a.mod??!1)!==Z3(t,o)||(a.alt??!1)!==t.altKey||(a.shift??!1)!==t.shiftKey),J3=t=>{y.useEffect(()=>{const a=o=>{if(!G3(o.target))for(const i of t){if(!Q3(o,i))continue;i.handler(o)!==!1&&o.preventDefault();return}};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t])},e4=({bootstrapError:t,onSelectWorkspace:a,onTriggerAddDialog:o,workspaces:i})=>{const l=y.useMemo(()=>{if(!V3())return[];const u=(i??[]).slice(0,9).map((f,p)=>({key:String(p+1),mod:!0,handler:()=>a(f.id)}));return[{key:"n",mod:!0,shift:!0,handler:()=>{t||o()}},...u]},[t,a,o,i]);J3(l)},t4=15e3,n4=async(t,a=t4)=>new Promise((o,i)=>{let l=!1;const u=window.setTimeout(()=>{l=!0,i(new Error("Hive runtime bootstrap timed out"))},a);t.then(f=>{l||(l=!0,window.clearTimeout(u),o(f))},f=>{l||(l=!0,window.clearTimeout(u),i(f))})}),a4=(t,a)=>a&&t.some(o=>o.id===a)?a:t[0]?.id??null,r4=(t,a)=>{if(t===null)return a;const o=new Map(t.map(i=>[i.id,i]));for(const i of a)o.set(i.id,i);return Array.from(o.values())},o4=(t,a,o)=>{y.useEffect(()=>{let i=!1;const l=$0().then(async()=>{const[u,f]=await Promise.all([PT(),XT().catch(()=>null)]);return{items:u,persistedId:f}});return n4(l).then(({items:u,persistedId:f})=>{i||t(p=>{const g=r4(p,u),m=a4(g,f);return a(m),f!==m&&X0(m).catch(b=>{console.error("[hive] swallowed:initSession.save",b)}),g})}).catch(u=>{i||(a(null),o&&o("Could not reach Hive runtime. Refresh once the runtime is back up.")),console.error("[hive] swallowed:initSession.bootstrap",u)}),()=>{i=!0}},[a,t,o])},s4=()=>{const t=y.useRef(null);return y.useCallback(a=>{if(typeof document>"u")return;const o=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(a):a.replace(/"/g,'\\"'),i=document.querySelector(`[data-worker-name="${o}"]`);i&&(i.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}),i.classList.add("worker-card-shell--highlight"),t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{i.classList.remove("worker-card-shell--highlight"),t.current=null},1e3))},[])},i4=({onWorkspaceCreated:t,onError:a,onOrchestratorRunStarted:o})=>{const{language:i}=Se(),[l,u]=y.useState({}),f=y.useCallback((g,m)=>{u(b=>({...b,[g]:m.ok?null:m.error})),m.ok&&m.run_id&&o?.(g,m.run_id)},[o]),p=y.useCallback(async g=>{try{const m=await YT({name:g.name,path:g.path,autostart_orchestrator:!0,command_preset_id:g.commandPresetId,startup_command:g.startupCommand??null,ui_language:i});return f(m.id,m.orchestrator_start),t({id:m.id,name:m.name,path:m.path}),m}catch(m){const b=m instanceof Error?m.message:"Failed to create workspace";throw a?.(b),m}},[i,t,a,f]);return{orchestratorAutostartErrors:l,recordOrchestratorResult:f,createNewWorkspace:p}},l4=(t,a)=>{const o=t.findIndex(l=>l.id===a),i=t.filter(l=>l.id!==a);return o<0?i[0]?.id??null:i[Math.min(o,i.length-1)]?.id??null},c4=({activeWorkspaceId:t,onActiveDeleted:a,selectWorkspace:o,setWorkersByWorkspaceId:i,setWorkspaces:l,workspaces:u})=>async f=>{const g=l4(u??[],f.id);await $T(f.id),l(m=>m?.filter(b=>b.id!==f.id)??m),i(m=>{const b={...m};return delete b[f.id],b}),f.id===t&&(a(),o(g))},u4=()=>{const[t,a]=y.useState(null),o=y.useRef(Promise.resolve());return{activeWorkspaceId:t,selectWorkspace:l=>{a(l),o.current=o.current.catch(Pa("selectWorkspace.prevQueue")).then(()=>X0(l)).catch(Pa("selectWorkspace.save"))},setActiveWorkspaceId:a}},Nx=500,d4=5e3,f4=5e3,m4=()=>({failureCount:0,inFlight:!1,lastSettledAt:null}),p4=(t,a)=>Math.min((a?Nx:d4)*2**t,f4),h4=(t,a)=>t.length!==a.length?!1:t.every((o,i)=>{const l=a[i];return l!==void 0&&o.commandPresetId===l.commandPresetId&&o.id===l.id&&o.lastPtyLine===l.lastPtyLine&&o.name===l.name&&o.pendingTaskCount===l.pendingTaskCount&&o.role===l.role&&o.status===l.status}),ab=(t,a)=>{const o=Object.keys(t),i=Object.keys(a);return o.length!==i.length?!1:i.every(l=>Object.hasOwn(t,l)&&h4(t[l]??[],a[l]??[]))},g4=(t,a={})=>{const o=t.join("\0"),i=y.useRef(a.activeWorkspaceId),l=y.useRef(new Map),u=y.useRef(null),[f,p]=y.useState({});return i.current=a.activeWorkspaceId,y.useEffect(()=>{if(!o){p({}),l.current.clear();return}let g=!1,m;const b=o.split("\0"),v=new Set(b);for(const T of l.current.keys())v.has(T)||l.current.delete(T);p(T=>{const N={};for(const A of b)N[A]=T[A]??[];return ab(T,N)?T:N});const k=T=>{let N=l.current.get(T);return N||(N=m4(),l.current.set(T,N)),N},S=T=>i.current===T,E=T=>{const N=k(T);N.inFlight||(N.inFlight=!0,aN(T).then(A=>{g||(N.failureCount=0,p(j=>{if(!v.has(T))return j;const O={};for(const D of b)O[D]=D===T?A:j[D]??[];return ab(j,O)?j:O}))}).catch(A=>{g||(N.failureCount=Math.min(N.failureCount+1,4),console.error("[hive] swallowed:workspaceWorkers.list",A))}).finally(()=>{N.inFlight=!1,N.lastSettledAt=g?null:Date.now()}))},w=()=>{const T=Date.now();for(const N of b){const A=k(N);if(A.inFlight)continue;if(A.lastSettledAt===null){E(N);continue}const j=p4(A.failureCount,S(N));T-A.lastSettledAt>=j&&E(N)}},C=(T=Nx)=>{g||(m!==void 0&&window.clearTimeout(m),m=window.setTimeout(()=>{m=void 0,w(),C()},T))};return u.current=()=>{m!==void 0&&(window.clearTimeout(m),m=void 0),w(),C()},w(),C(),()=>{g=!0,m!==void 0&&window.clearTimeout(m),u.current&&(u.current=null)}},[o]),y.useEffect(()=>{const g=a.activeWorkspaceId;if(!g||!o.split("\0").includes(g))return;const m=l.current.get(g);m&&!m.inFlight&&(m.lastSettledAt=null,m.failureCount=0),u.current?.()},[a.activeWorkspaceId,o]),[f,p]},sm="hive:terminal-visible-resize",v4=t=>new CustomEvent(sm,{detail:{runId:t}}),y4="\x1B[200~",rb="\x1B[201~",b4=(t,a)=>{const o=t.split(rb).join("");return a?.modes?.bracketedPasteMode===!1?o:`${y4}${o}${rb}`},jt="\x1B",ob="\x07",w4=new RegExp(`${jt}\\[[0-?]*[ -/]*[@-~]`,"gu"),x4=new RegExp(`${jt}\\][^${ob}${jt}]*(?:${ob}|${jt}\\\\)`,"gu"),k4=new RegExp("[\0-]","gu"),S4=new RegExp(`${jt}\\[([0135]) q`,"gu"),E4=new RegExp(`${jt}\\[[0135] q`,"u"),C4=new RegExp(`${jt}\\[[246] q`,"gu"),jx=new RegExp(`${jt}\\[[0-?]*K`,"u"),T4=new RegExp(`${jt}\\[[0-9]*D`,"u"),N4=new RegExp(`${jt}\\[[0-9]+(?:;[0-9]+)?[Hf]`,"gu"),_x="\b",Ax="",j4="",_4="",A4=t=>{switch(t){case"3":return"4";case"5":return"6";default:return"2"}},R4=t=>t.replace(x4,"").replace(w4,"").replace(k4,""),O4=t=>R4(t).trim().length>0,D4=t=>jx.test(t)&&(T4.test(t)||t.includes(_x)||t.includes(Ax)),M4=t=>!O4(t)&&t.includes(`${jt}[?2026`)&&t.includes(`${jt}[?25`)&&E4.test(t)&&jx.test(t)&&!D4(t),sb=(t,a)=>{let o=null;a.lastIndex=0;for(const i of t.matchAll(a))o=i[0];return o},ib=t=>t.includes(_x)||t.includes(Ax)||t.includes(j4)||t.includes(_4)||t.includes(`${jt}[3~`),lb=(t,a={})=>{const o=t.replace(S4,(u,f)=>`${jt}[${A4(f)} q`);if(!M4(t))return{chunk:o,suppress:!1};if(a.preservePromptEditFrame)return{chunk:o,consumedPromptEraseInput:!0,suppress:!1};const i=sb(o,N4);return i?{chunk:`${sb(o,C4)??""}${jt}[?25h${i}`,suppress:!1}:{chunk:o,suppress:!0}},L4=(t,a)=>{let o,i=!1,l=!1;const u=()=>{t.value="",t.scrollLeft=0,t.scrollTop=0},f=()=>{o!==void 0&&clearTimeout(o),o=setTimeout(()=>{o=void 0,i=!1,l=!1,a.setComposing(!1)},0)},p=E=>E.data||t.value,g=E=>E.inputType==="insertText"||E.inputType==="insertFromComposition"||E.inputType==="insertReplacementText"||E.inputType==="insertDictationResult",m=()=>{i=!0,l=!1,a.setComposing(!0)},b=()=>{i=!0,a.setComposing(!0)},v=E=>{const C=E.data||t.value;!l&&C&&a.commit(C),u(),f()},k=E=>{const w=E;if(i||w.isComposing){if(g(w)){const C=p(w);C&&(a.commit(C),l=!0),u()}return}w.defaultPrevented&&g(w)&&u()},S={capture:!0};return t.addEventListener("compositionstart",m,S),t.addEventListener("compositionupdate",b,S),t.addEventListener("compositionend",v,S),t.addEventListener("input",k,S),()=>{o!==void 0&&clearTimeout(o),t.removeEventListener("compositionstart",m,S),t.removeEventListener("compositionupdate",b,S),t.removeEventListener("compositionend",v,S),t.removeEventListener("input",k,S)}},z4=()=>typeof navigator>"u"?!1:/Mac|iPhone|iPad/.test(navigator.platform),Mn={killToLineStart:"",lineStart:"",lineEnd:"",killWordBack:"\x1B",wordBack:"\x1Bb",wordForward:"\x1Bf",shiftEnter:"\x1B[13;2u"},H4=(t,a={})=>{const o=a.isMac??z4();if(t.key==="Enter"&&t.shiftKey)return t.type==="keypress"?{kind:"send",bytes:Mn.shiftEnter}:{kind:"block"};if(!o&&t.type==="keydown"&&t.ctrlKey&&!t.shiftKey&&!t.altKey&&!t.metaKey&&(t.key==="c"||t.key==="C")&&a.hasSelection)return{kind:"copy"};if(!o||t.type!=="keydown")return{kind:"passthrough"};const i=t.metaKey&&!t.ctrlKey&&!t.altKey&&!t.shiftKey,l=t.altKey&&!t.metaKey&&!t.ctrlKey;if(i)switch(t.key){case"Backspace":return{kind:"send",bytes:Mn.killToLineStart};case"ArrowLeft":return{kind:"send",bytes:Mn.lineStart};case"ArrowRight":return{kind:"send",bytes:Mn.lineEnd};case"k":case"K":return{kind:"clear"}}if(l)switch(t.key){case"Backspace":return{kind:"send",bytes:Mn.killWordBack};case"ArrowLeft":return{kind:"send",bytes:Mn.wordBack};case"ArrowRight":return{kind:"send",bytes:Mn.wordForward}}return{kind:"passthrough"}},B4=16,U4=.3,W4={up:"A",down:"B",right:"C",left:"D"},im=(t,a)=>{const o=W4[a];return t?`\x1BO${o}`:`\x1B[${o}`},I4=(t,a,o)=>a==="codex"||a==="grok"||a==="opencode"?o==="up"?"\x1B[5~":"\x1B[6~":im(t.modes?.applicationCursorKeysMode,o),q4=t=>t==="codex"||t==="grok"||t==="opencode",Rx=(t,a="default")=>{let o=0;return i=>{if(t.buffer?.active?.type!=="alternate")return o=0,{handled:!1,input:null};if(!q4(a)&&t.modes?.mouseTrackingMode&&t.modes.mouseTrackingMode!=="none")return o=0,{handled:!1,input:null};if(i.deltaY===0||i.shiftKey)return{handled:!1,input:null};let l=i.deltaY;return i.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(l/=B4,Math.abs(i.deltaY)<50&&(l*=U4),o+=l,l=Math.trunc(o),o%=1):o=0,l===0?{handled:!0,input:null}:{handled:!0,input:I4(t,a,l<0?"up":"down")}}},P4=({element:t,profile:a="default",sendInput:o,terminal:i})=>{const l=Rx(i,a),u=p=>{const{handled:g,input:m}=l(p);return g?(p.preventDefault(),p.stopPropagation(),m&&o(m),!1):!0};if(typeof i.attachCustomWheelEventHandler=="function")return i.attachCustomWheelEventHandler(u),()=>{};const f=p=>{u(p)||p.stopImmediatePropagation()};return t.addEventListener("wheel",f,{capture:!0,passive:!1}),()=>t.removeEventListener("wheel",f,{capture:!0})},F4=(t,a={})=>{switch(t){case"esc":return"\x1B";case"tab":return" ";case"enter":return"\r";case"arrowUp":return im(a.applicationCursorKeys,"up");case"arrowDown":return im(a.applicationCursorKeys,"down");case"arrowRight":return a.applicationCursorKeys?"\x1BOC":"\x1B[C";case"arrowLeft":return a.applicationCursorKeys?"\x1BOD":"\x1B[D";case"home":return"\x1B[H";case"end":return"\x1B[F";case"ctrlC":return"";case"ctrlD":return"";case"ctrlZ":return"";case"ctrlL":return"\f";case"ctrlR":return"";case"ctrlU":return Mn.killToLineStart;case"ctrlA":return Mn.lineStart;case"ctrlE":return Mn.lineEnd;case"ctrlW":return""}},K4="Invalid terminal control message",Y4=t=>{let a;try{a=JSON.parse(String(t))}catch{return null}if(!a||typeof a!="object")return null;const o=a;return o.type==="error"&&typeof o.message=="string"?{type:"error",message:o.message}:o.type==="exit"&&(o.code===null||typeof o.code=="number")?{type:"exit",code:o.code}:o.type==="restore"&&typeof o.snapshot=="string"?{type:"restore",snapshot:o.snapshot}:null},$4=({initialSize:t,onError:a,onExit:o,onOutput:i,onRestore:l,onClose:u,runId:f})=>{const p=crypto.randomUUID(),g={...t,clientId:p},m=F0(),b=m.openWebSocket(`/ws/terminal/${f}/io`,g),v=m.openWebSocket(`/ws/terminal/${f}/control`,g);let k=!1,S=!1,E=!1;const w=[];let C=null;const T=()=>{S||E||(E=!0,u?.())};b.onclose=T,v.onclose=T;const N=()=>{!C||v.readyState!==v.OPEN||(v.send(JSON.stringify({type:"resize",...C})),C=null)};return b.onmessage=A=>{const j=typeof A.data=="string"?A.data:"",O=D=>{v.readyState===v.OPEN&&v.send(JSON.stringify({type:"output_ack",bytes:D}))};if(!k){w.push({chunk:j,acknowledge:O});return}i(j,O)},v.onopen=()=>{N()},v.onmessage=A=>{const j=Y4(A.data);if(!j){a(K4);return}if(j.type==="exit"&&o(j.code),j.type==="error"&&a(j.message),j.type==="restore"){l(j.snapshot),k=!0,v.readyState===v.OPEN&&v.send(JSON.stringify({type:"restore_complete"}));for(const O of w.splice(0))i(O.chunk,O.acknowledge)}},{dispose(){S=!0,b.close(),v.close()},resize(A,j,O,D){C={cols:A,rows:j},O!==void 0&&(C.pixelWidth=O),D!==void 0&&(C.pixelHeight=D),N()},sendBinaryInput(A){if(b.readyState!==b.OPEN)return;const j=new Uint8Array(A.length);for(let O=0;O<A.length;O++)j[O]=A.charCodeAt(O)&255;b.send(j)},sendInput(A){b.readyState===b.OPEN&&b.send(A)}}},V4=16,G4=.08,X4=.96,Z4=.025,cb=5,Q4=100,J4=8,eO=6,tO=4,nO=.5,aO=250,rO=24,oO=2,sO=".xterm-viewport",iO=".xterm-screen";function lO({element:t,profile:a="default",sendInput:o,terminal:i}){let l=null,u=0,f=0,p,g=0,m=null,b=0,v=!1,k=null,S=null,E=V4,w=0,C=0,T=null,N=[];const A=Rx(i,a),j=()=>{m!==null&&(window.cancelAnimationFrame(m),m=null)},O=()=>{T!==null&&(window.cancelAnimationFrame(T),T=null)},D=()=>(k?.isConnected||(k=t.querySelector(sO)),k),L=()=>(S?.isConnected||(S=t.querySelector(iO)),S),q=()=>{const ie=D(),le=i.rows;if(!ie||!le||le<=0)return;const ce=ie.clientHeight/le;ce>=6&&ce<=64&&(E=ce)},$=()=>{const ie=L();ie&&(ie.style.transform=w!==0?`translateY(${-w}px)`:"")},ae=()=>{w!==0&&(w=0,$())},G=()=>{if(Math.abs(w)>=E/2){const ie=D();if(ie){const le=ie.scrollHeight-ie.clientHeight,ce=w>0?E:-E;ie.scrollTop=Math.min(le,Math.max(0,ie.scrollTop+ce))}}ae()},W=ie=>{const le=D();if(!le)return"missing";const ce=le.scrollHeight-le.clientHeight;if(ce<=0)return ae(),"stuck";const de=w+ie,Te=Math.trunc(de/E);let xe=de-Te*E;const qe=le.scrollTop,Qe=Math.min(ce,Math.max(0,qe+Te*E)),_t=Qe!==qe;_t&&(le.scrollTop=Qe),(Qe<=0&&de<0||Qe>=ce&&de>0)&&(xe=0);const nn=xe!==w;return w=xe,nn&&$(),_t||nn?"moved":"stuck"},ee=ie=>{u+=ie/E;const le=Math.trunc(u);return u%=1,le===0||i.scrollLines?.(le),!0},Q=(ie,le)=>{const ce=[];for(let de=0;de<le;de++){const{handled:Te,input:xe}=A({deltaMode:WheelEvent.DOM_DELTA_LINE,deltaY:ie,shiftKey:!1});if(!Te)break;xe&&ce.push(xe)}return ce.length>0&&o(ce.join("")),ce.length},V=ie=>{f+=ie/E;const le=Math.trunc(f);if(f%=1,le===0)return!1;const ce=a==="codex"||a==="opencode"?tO:eO;return Q(le<0?-1:1,Math.min(Math.abs(le),ce))>0},M=ie=>{const le=i.buffer?.active?.type;return le!==p&&(u=0,f=0,p=le,ae()),le==="alternate"?{moved:V(ie),normalBuffer:!1}:{moved:W(ie)==="moved"||ee(ie),normalBuffer:!0}},P=()=>{T=null;const ie=C;C=0,ie!==0&&(v=M(ie).normalBuffer)},I=()=>{T===null&&(T=window.requestAnimationFrame(P))},Z=(ie,le)=>{N.push({t:ie,y:le}),N.length>J4&&N.shift()},F=ie=>{const le=ie-Q4,ce=N.filter(Qe=>Qe.t>=le),de=ce[0],Te=ce[ce.length-1];if(!de||!Te||de===Te)return 0;const xe=Te.t-de.t;if(xe<=0)return 0;const qe=(de.y-Te.y)/xe;return Math.max(-cb,Math.min(cb,qe))};let R=0;const B=()=>{if(m=null,R===0)return;if(i.buffer?.active?.type!=="alternate"){R=0;return}const ie=R>0?1:-1,le=Math.min(Math.abs(R),oO);if(Q(ie,le)<le){R=0;return}R-=ie*le,R!==0&&(m=window.requestAnimationFrame(B))},se=ie=>{const le=Math.min(32,Math.max(1,ie-b));b=ie;const{moved:ce,normalBuffer:de}=M(g*le);if(!ce||!de){m=null,u=0,g=0,G();return}if(g*=X4**(le/16.67),Math.abs(g)<Z4){m=null,u=0,G();return}m=window.requestAnimationFrame(se)},te=ie=>{j(),R=0,O(),C=0,N=[],l=ie.touches.length===1?ie.touches[0]?.clientY??null:null,l!==null&&Z(ie.timeStamp,l),g=0,v=!1,D(),q()},fe=ie=>{if(l===null||ie.touches.length!==1)return;const le=ie.touches[0]?.clientY??l,ce=l-le;Math.abs(ce)<1||(l=le,ie.preventDefault(),C+=ce,Z(ie.timeStamp,le),I())},me=ie=>{l=null,O(),P();const le=F(ie.timeStamp);if(N=[],v&&Math.abs(le)>=G4){g=le,b=performance.now(),m=window.requestAnimationFrame(se);return}if(!v&&a!=="opencode"&&Math.abs(le)>=nO&&i.buffer?.active?.type==="alternate"){const ce=Math.min(rO,Math.round(Math.abs(le)*aO/E));if(ce>0){R=le>0?ce:-ce,m=window.requestAnimationFrame(B);return}}g=0,u=0,G()},ue=()=>{j(),R=0,O(),C=0,N=[],l=null,u=0,f=0,g=0,v=!1,ae()};return t.addEventListener("touchstart",te,{passive:!0}),t.addEventListener("touchmove",fe,{passive:!1}),t.addEventListener("touchend",me,{passive:!0}),t.addEventListener("touchcancel",ue,{passive:!0}),()=>{t.removeEventListener("touchstart",te),t.removeEventListener("touchmove",fe),t.removeEventListener("touchend",me),t.removeEventListener("touchcancel",ue),j(),O(),ae()}}const cO=(t=()=>typeof document<"u"?document.createElement("canvas"):null)=>{const a=t();if(!a||typeof a.getContext!="function")return!1;try{return!!(a.getContext("webgl2")||a.getContext("webgl"))}catch{return!1}},uO=t=>t instanceof Error&&t.message?`Terminal failed to load: ${t.message}`:"Terminal failed to load. Refresh this page and try again.",dO=new RegExp("\x1B\\[M([\\s\\S])([\\s\\S])([\\s\\S])","g"),fO=new TextEncoder,mO=5e3,pO=(t,a,o,i)=>{const l=a.charCodeAt(0)-32,u=o.charCodeAt(0)-32,f=i.charCodeAt(0)-32;if(l<0||u<1||f<1)return t;const g=(l&3)===3&&(l&32)===0&&(l&64)===0?"m":"M";return`\x1B[<${l};${u};${f}${g}`},hO=(t,a)=>{if(a!=="grok"&&a!=="opencode")return{binary:!0,chunk:t};const o=t.replace(dO,pO);return{binary:o===t,chunk:o}},gO=(t,a="default",o)=>{const i=xt(),l=y.useRef(null),[u,f]=y.useState(null),[p,g]=y.useState("connecting"),m=y.useRef("connecting"),[b,v]=y.useState(0),k=y.useRef(null),S=y.useRef(null),E=y.useRef(!1),w=y.useRef(!1),[C,T]=y.useState("canvas"),[N,A]=y.useState(!1),j=y.useRef(!1),O=y.useRef(o);y.useEffect(()=>{O.current=o},[o]);const D=y.useCallback(G=>{T(G);const W=l.current;W&&(W.dataset.renderer=G)},[]),L=y.useCallback(G=>{E.current||(a==="codex"&&ib(G)&&(w.current=!0),k.current?.sendInput(G))},[a]),q=y.useCallback(G=>{const W=S.current?.modes?.applicationCursorKeysMode;L(F4(G,W===void 0?{}:{applicationCursorKeys:W}))},[L]),$=y.useCallback(G=>{const W=b4(G,S.current??void 0);return k.current?.sendInput(W),W},[]),ae=y.useCallback(()=>{const G=()=>{S.current?.scrollToBottom();const W=l.current?.querySelector(".xterm-viewport");W&&(W.scrollTop=W.scrollHeight)};G(),window.requestAnimationFrame(()=>{G(),window.requestAnimationFrame(G)}),window.setTimeout(G,80),j.current=!1,A(!1)},[]);return y.useEffect(()=>{if(!l.current)return;let G=!1,W,ee,Q,V,M,P,I,Z,F,R,B,se,te=null,fe,me,ue,ie,le=0,ce;f(null),m.current="connecting",g("connecting"),j.current=!1,A(!1);const de=xe=>{m.current!==xe&&(m.current=xe,g(xe))},Te=()=>{const xe=++le;VT(t).then(qe=>{if(!(G||xe!==le)){if(!qe){de("stopped"),O.current?.();return}v(Qe=>Qe+1)}}).catch(qe=>{if(!(G||xe!==le)){if(qe instanceof G0&&(qe.status===401||qe.status===403)){f(qe.message);return}v(Qe=>Qe+1)}})};return Promise.all([Nt(()=>import("./xterm-B-qIQCd3.js"),[]),Nt(()=>import("./addon-fit-DX4qG4td.js"),[]),Nt(()=>import("./addon-unicode11-Bt8F3D7-.js"),[]),Nt(()=>import("./addon-clipboard-wHJhZAA4.js"),[])]).then(([xe,qe,Qe,_t])=>{if(G||!l.current)return;const nn=typeof window<"u"?getComputedStyle(document.documentElement):null,an=nn?.getPropertyValue("--bg-crust").trim()||"#0e0e0e",jn=nn?.getPropertyValue("--text-primary").trim()||"#ebebeb",De=new xe.Terminal({allowProposedApi:!0,convertEol:!1,fontFamily:"'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:i?12:13,letterSpacing:0,lineHeight:1,scrollback:1e4,theme:{background:an,foreground:jn}}),vn=new qe.FitAddon;De.loadAddon(vn),De.loadAddon(new Qe.Unicode11Addon),De.unicode.activeVersion="11",De.loadAddon(new _t.ClipboardAddon),De.open(l.current),D("canvas"),vn.fit(),P=De,S.current=De,I=vn;const fa=()=>{const ve=De.buffer.active,Oe=ve.viewportY<ve.baseY;j.current!==Oe&&(j.current=Oe,A(Oe))},ma=()=>{ie===void 0&&(ie=window.requestAnimationFrame(()=>{ie=void 0,fa()}))};me=De.onScroll(ma),ue=De.buffer.onBufferChange(ma);const we=ve=>{a==="codex"&&ib(ve)&&(w.current=!0),M?.sendInput(ve)};B=P4({element:l.current,profile:a,sendInput:we,terminal:De}),i&&(se=lO({element:l.current,profile:a,sendInput:we,terminal:De})),te=l.current.querySelector(".xterm-helper-textarea"),te&&(fe=L4(te,{setComposing:ve=>{E.current=ve},commit:we})),typeof De.attachCustomKeyEventHandler=="function"&&De.attachCustomKeyEventHandler(ve=>{const Oe=H4(ve,{hasSelection:De.hasSelection()});switch(Oe.kind){case"send":return ve.preventDefault(),we(Oe.bytes),!1;case"clear":return ve.preventDefault(),De.clear(),!1;case"copy":{ve.preventDefault();const rn=De.getSelection();return rn&&navigator.clipboard?.writeText(rn).catch(()=>{}),De.clearSelection(),!1}case"block":return!1;case"passthrough":return!0}});const at=()=>{const ve=l.current;return ve?.isConnected?!ve.closest('[data-terminal-host-parked="true"]'):!1},In=()=>{if(!l.current)return{};const ve=l.current.clientWidth,Oe=l.current.clientHeight,rn={};return Oe>0&&(rn.pixelHeight=Oe),ve>0&&(rn.pixelWidth=ve),rn},ke=()=>{if(!l.current||!at())return;const ve=In();if(!ve.pixelHeight||!ve.pixelWidth||ce&&ce.pixelHeight===ve.pixelHeight&&ce.pixelWidth===ve.pixelWidth)return;I?.fit();const Oe={cols:P?.cols??80,rows:P?.rows??24,...In()};ce&&ce.cols===Oe.cols&&ce.rows===Oe.rows&&ce.pixelHeight===Oe.pixelHeight&&ce.pixelWidth===Oe.pixelWidth||(ce=Oe,M?.resize(Oe.cols,Oe.rows,Oe.pixelWidth,Oe.pixelHeight))},Re=()=>{F&&window.clearTimeout(F),F=window.setTimeout(()=>{F=void 0,ke()},50)};Nt(()=>import("./addon-web-links-DIbG5aQx.js"),[]).then(ve=>{G||P!==De||De.loadAddon(new ve.WebLinksAddon)}).catch(()=>{}),cO()&&Nt(()=>import("./addon-webgl-DCtw1yLn.js"),[]).then(ve=>{if(!(G||P!==De))try{const Oe=new ve.WebglAddon;Oe.onContextLoss(()=>{Oe.dispose(),D("canvas")}),De.loadAddon(Oe),D("webgl"),Re()}catch{D("canvas")}}).catch(()=>{D("canvas")}),M=$4({initialSize:{cols:De.cols,rows:De.rows,...In()},onError(ve){f(ve)},onExit(){de("stopped"),O.current?.()},onOutput(ve,Oe){de("running");const rn=fO.encode(ve).byteLength;if(a==="codex"){const Uo=lb(ve,{preservePromptEditFrame:w.current});if(Uo.consumedPromptEraseInput&&(w.current=!1),Uo.suppress){Oe(rn);return}De.write(Uo.chunk,()=>Oe(rn));return}De.write(ve,()=>Oe(rn))},onRestore(ve){de("running"),De.write(a==="codex"?lb(ve).chunk:ve)},onClose(){G||Te()},runId:t}),R=window.setTimeout(()=>{R=void 0,!(G||m.current!=="connecting")&&v(ve=>ve+1)},mO),k.current=M,V=De.onData(ve=>{E.current||we(ve)}),typeof De.onBinary=="function"&&(Q=De.onBinary(ve=>{const Oe=hO(ve,a);Oe.binary?M?.sendBinaryInput(Oe.chunk):M?.sendInput(Oe.chunk)})),ke(),typeof ResizeObserver<"u"&&l.current&&(Z=new ResizeObserver(Re),Z.observe(l.current)),W=ve=>{ve.detail?.runId===t&&Re()},ee=()=>Re(),window.addEventListener(sm,W),window.addEventListener("resize",ee)}).catch(xe=>{G||(f(uO(xe)),de("stopped"))}),()=>{G=!0,W&&window.removeEventListener(sm,W),ee&&window.removeEventListener("resize",ee),Z?.disconnect(),F&&window.clearTimeout(F),R&&window.clearTimeout(R),B?.(),se?.(),fe?.(),ie!==void 0&&window.cancelAnimationFrame(ie),me?.dispose(),ue?.dispose(),Q?.dispose(),V?.dispose(),M?.dispose(),P?.dispose(),I?.dispose(),k.current=null,S.current=null}},[t,a,b]),{containerRef:l,error:u,status:p,sendInput:L,sendKey:q,beginPaste:$,renderer:C,isScrolledUp:N,scrollToBottom:ae}},vO={connecting:"terminal.statusConnecting",running:"terminal.statusRunning",stopped:"common.stopped"},lm="hive-terminal-parking-lot",yO=500,bO=t=>[`worker-pty-${t}`,`orch-pty-${t}`,`shell-pty-${t}`],wO=t=>{for(let a=t;a;a=a.parentElement){if(a.hidden||a.getAttribute("aria-hidden")==="true"||a.classList.contains("hidden"))return!0;const o=window.getComputedStyle?.(a);if(o?.display==="none"||o?.visibility==="hidden")return!0}return!1},xO=t=>{const a=Array.from(document.querySelectorAll("[data-pty-slot]")).filter(o=>o.id===t&&o.isConnected&&!wO(o));return a[a.length-1]??null},kO=()=>{let t=document.getElementById(lm);return t||(t=document.createElement("div"),t.id=lm,t.hidden=!0,t.style.display="none",(document.body??document.documentElement).appendChild(t)),t},_f=()=>{const t=document.getElementById(lm);t&&t.childElementCount===0&&t.remove()},$l=new Set;let Fs,Ks;const ub=()=>{for(const t of $l)t()},SO=()=>{Fs?.disconnect(),Fs=void 0,Ks!==void 0&&(window.clearInterval(Ks),Ks=void 0)},EO=()=>{if(Fs||Ks!==void 0)return;const t=document.body??document.documentElement;if(typeof MutationObserver<"u"&&t){Fs=new MutationObserver(ub),Fs.observe(t,{attributeFilter:["aria-hidden","class","data-pty-slot","hidden","id","style"],attributes:!0,childList:!0,subtree:!0});return}Ks=window.setInterval(ub,100)},CO=t=>($l.add(t),EO(),()=>{$l.delete(t),$l.size===0&&SO()}),TO=[50,150,300],NO=t=>{const a=[],o=[],i=()=>window.dispatchEvent(v4(t)),l=(u,f)=>{const p=window.setTimeout(()=>{const g=o.indexOf(p);g>=0&&o.splice(g,1),f()},u);o.push(p)};if(typeof window.requestAnimationFrame=="function"){const u=window.requestAnimationFrame(()=>{i();const f=window.requestAnimationFrame(i);a.push(f)});a.push(u)}else l(0,i);for(const u of TO)l(u,i);return()=>{for(const u of a)window.cancelAnimationFrame?.(u);for(const u of o)window.clearTimeout(u);a.length=0,o.length=0}},jO=t=>{const[a,o]=y.useState(null);return y.useEffect(()=>{const i=bO(t),l=()=>{for(const f of i){const p=xO(f);if(p)return p}return null},u=()=>{const f=l();o(p=>p===f?p:f)};return u(),CO(u)},[t]),a},_O=(t,a)=>{const[o,i]=y.useState(!1),[l,u]=y.useState(null),f=y.useRef(null),p=y.useRef(void 0),g=y.useRef(null),m=y.useRef(void 0),b=y.useCallback(()=>{p.current!==void 0&&(window.clearTimeout(p.current),p.current=void 0)},[]),v=y.useCallback(()=>{m.current?.(),m.current=void 0},[]),k=y.useCallback(()=>{const E=f.current;E?.dataset.terminalSlotRunId===t&&delete E.dataset.terminalSlotRunId,f.current=null},[t]),S=y.useCallback(E=>{const w=f.current;w&&w!==E&&w.dataset.terminalSlotRunId===t&&delete w.dataset.terminalSlotRunId,E.dataset.terminalSlotRunId=t,f.current=E},[t]);return y.useLayoutEffect(()=>{const E=document.createElement("div");return E.dataset.terminalHostRunId=t,E.dataset.terminalHostParked="false",E.className="h-full min-h-0 w-full min-w-0",g.current=E,u(E),()=>{b(),k(),v(),E.remove(),g.current=null,_f()}},[k,b,v,t]),y.useLayoutEffect(()=>{if(a){b(),i(!0);return}if(!(!o||p.current!==void 0))return p.current=window.setTimeout(()=>{p.current=void 0,i(!1)},yO),b},[o,b,a]),y.useLayoutEffect(()=>{const E=g.current;if(!E)return;if(!o){v(),k(),E.remove(),E.dataset.terminalHostParked="false",_f();return}const w=a??kO();if(E.parentElement===w){a?S(a):k();return}const C=E.parentElement!==null,T=document.activeElement;a||(v(),k()),!a&&T instanceof HTMLElement&&E.contains(T)&&T.blur(),E.dataset.terminalHostParked=a?"false":"true",w.appendChild(E),a&&S(a),_f(),a&&C&&(v(),m.current=NO(t))},[o,k,v,S,t,a]),o?l:null},AO=({inputProfile:t="default",onRunExited:a,runId:o,startupBlockedReason:i,title:l})=>{const u=jO(o),f=_O(o,u);return f?xc.createPortal(c.jsx(RO,{inputProfile:t,onRunExited:a,runId:o,startupBlockedReason:i??null,title:l}),f):null},RO=({inputProfile:t,onRunExited:a,runId:o,startupBlockedReason:i,title:l})=>{const{t:u}=Se(),f=xt(),p=y.useCallback(()=>{a?.(o)},[a,o]),{containerRef:g,error:m,status:b,isScrolledUp:v,scrollToBottom:k}=gO(o,t,p),S=vO[b],E=y.useCallback(()=>{g.current?.querySelector(".xterm-helper-textarea")?.blur(),k()},[g,k]);return c.jsxs("div",{className:"flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden",children:[c.jsx("p",{className:"sr-only",children:S?u(S):b}),m?c.jsx("p",{role:"alert",className:"mono shrink-0 break-words px-3 py-2 text-xs",style:{background:"color-mix(in oklab, var(--status-red) 12%, transparent)",borderBottom:"1px solid color-mix(in oklab, var(--status-red) 30%, transparent)",color:"var(--status-red)"},children:m}):null,!m&&i==="first_run_setup"?c.jsx("p",{className:"mono shrink-0 break-words px-3 py-2 text-xs","data-testid":`terminal-startup-setup-${o}`,style:{background:"color-mix(in oklab, var(--status-orange) 12%, transparent)",borderBottom:"1px solid color-mix(in oklab, var(--status-orange) 28%, transparent)",color:"var(--text-secondary)"},children:u("terminal.firstRunSetup")}):null,c.jsxs("div",{className:"relative h-full min-h-0 w-full min-w-0 flex-1 overflow-hidden",children:[c.jsx("div",{"data-testid":`terminal-${o}`,ref:g,className:"bg-crust h-full min-h-0 w-full min-w-0 overflow-hidden"}),!m&&b==="connecting"?c.jsx("div",{role:"status",className:"mono pointer-events-none absolute inset-0 flex items-center justify-center px-4 text-center text-xs",style:{color:"var(--text-muted)"},children:u("terminal.statusConnecting")}):null,f&&v?c.jsx(OO,{label:u("terminal.scrollToBottom"),onJump:E}):null]})]})},OO=({label:t,onJump:a})=>{const o=y.useRef(null),i=y.useRef(Number.NEGATIVE_INFINITY),l=y.useCallback(u=>{u.preventDefault?.(),u.stopPropagation?.();const f=u.timeStamp??performance.now();f-i.current<250||(i.current=f,a())},[a]);return y.useEffect(()=>{const u=o.current;if(!u)return;const f=p=>{p.cancelable&&p.preventDefault(),p.stopImmediatePropagation(),l(p)};return u.addEventListener("touchstart",f,{capture:!0,passive:!1}),u.addEventListener("pointerdown",f,{capture:!0}),u.addEventListener("mousedown",f,{capture:!0}),()=>{u.removeEventListener("touchstart",f,{capture:!0}),u.removeEventListener("pointerdown",f,{capture:!0}),u.removeEventListener("mousedown",f,{capture:!0})}},[l]),c.jsx("button",{ref:o,type:"button","aria-label":t,className:"icon-btn icon-btn--primary mobile-terminal-jump-button absolute bottom-2 left-1/2 -translate-x-1/2",tabIndex:-1,onClick:l,onFocus:u=>u.currentTarget.blur(),children:t})},DO=({hidden:t=!1,onTerminalRunExited:a,optimisticRuns:o=[],terminalRuns:i,workspaceId:l})=>{const{t:u}=Se(),f=Ex(i,o,l);return c.jsx("section",{hidden:t,"aria-hidden":t||void 0,"aria-label":u("terminalPanels.aria"),children:f.map(p=>c.jsx(AO,{inputProfile:p.terminal_input_profile??"default",onRunExited:g=>a?.(l,g),runId:p.run_id,startupBlockedReason:p.startup_blocked_reason??null,title:`${p.agent_name} (${p.status})`},p.run_id))})},MO=[{version:"2.1.12",date:"2026-06-25",en:["Hive now starts on the less common local port 9483 by default, reducing collisions with other development services. You can still use `hive --port 0` to ask the OS for any free port.","Pi is now a built-in agent preset. Hive can launch `pi --approve`, wait for the Pi prompt before sending startup input, and allow Pi in workflow CLI policy.","The Supervisor MCP adapter and development proxy now follow the same default runtime port, so external supervisors and local development stay aligned."],zh:["Hive 默认启动端口改为较少冲突的本机端口 9483,降低和常见开发服务撞端口的概率;仍可用 `hive --port 0` 让系统自动分配空闲端口。","Pi 现在是内置 agent preset。Hive 可以启动 `pi --approve`,等待 Pi 提示符就绪后再注入启动输入,并允许 workflow CLI policy 使用 Pi。","Supervisor MCP adapter 和开发代理也改为跟随同一个默认 runtime 端口,外部 supervisor 和本地开发配置保持一致。"]},{version:"2.1.11",date:"2026-06-25",en:["Hive now includes a local Supervisor MCP adapter, so external agents can hand goals to the Hive Orchestrator and wait on durable structured goal events.","Orchestrators can report external goal progress, blocked states, failures, and completion with `team goal report`, while external supervisors still cannot directly spawn members, send member tasks, read raw scrollback, or write PTYs.","OpenCode startup input delivery is more reliable after completed turns and interrupt-status screens, and Codex prompt editing now preserves repaint frames after Backspace/Delete-style input."],zh:["Hive 现在包含本地 Supervisor MCP adapter,外部 agent 可以把目标交给 Hive Orchestrator,并通过持久化结构化 goal events 等待进度和结果。","Orchestrator 可以用 `team goal report` 回报 external goal 的进度、阻塞、失败和完成;外部 supervisor 仍不能直接 spawn 成员、给成员派单、读取原始 scrollback 或写 PTY。","OpenCode 在完成一轮和显示 interrupt 状态后的启动输入投递更可靠;Codex 在 Backspace/Delete 类输入后的提示行重绘也会被保留。"]},{version:"2.1.10",date:"2026-06-23",en:["One-click scenario teams now start their members immediately, so they are ready for the Orchestrator to assign work instead of appearing as stopped cards.","OpenCode members are more reliable after startup: Hive now recognizes OpenCode completed-turn footers as a safe dispatch point and asks members to acknowledge received dispatches.","Terminal panes now follow real run lifecycle events more closely, and Codex cursor repaint frames keep the final cursor position during editing."],zh:["一键场景组队现在会立即启动创建出的成员,成员不会再以 stopped 卡片停在那里,Orchestrator 可以直接派工。","OpenCode 成员启动后的派发更可靠:Hive 现在能识别 OpenCode 完成一轮后的 footer,并要求成员收到派单后先发出确认状态。","终端面板现在更贴近真实 run 生命周期;Codex 编辑时的光标刷新也会保留最终光标位置。"]},{version:"2.1.9",date:"2026-06-23",en:["Hive now gives Orchestrators a shorter startup prompt and points them to focused `team guide` topics when they need dispatch, task, memory, workflow, or member details.","Agent-facing language now consistently talks about Hive members, matching the product model you see in the UI.","This release also includes the Codex CJK backspace repaint fix and the cleaner desktop member-window outside-click close behavior."],zh:["Hive 现在给 Orchestrator 注入更短的启动提示,并在需要派单、任务、记忆、workflow 或成员细节时,引导它读取对应的 `team guide`。","面向 agent 的文案统一改为 Hive 成员口径,更贴近界面里的产品模型。","本次也包含 Codex 中文/CJK 删除键刷新修复,以及桌面端成员窗口点击外部关闭的更清爽交互。"]},{version:"2.1.8",date:"2026-06-23",en:["Codex terminals now repaint CJK input correctly when you press Backspace, so deleted characters disappear immediately instead of lingering on screen.","Desktop member windows no longer show a visible close button over the terminal corner; click outside the window to close it, while mobile keeps its full-screen close button."],zh:["Codex 终端现在能正确刷新中文/CJK 输入:按下删除键后,被删字符会立即从画面消失,不再残留。","桌面端成员窗口不再在终端右上角显示关闭按钮;点击窗口外即可关闭,移动端全屏窗口仍保留关闭按钮。"]},{version:"2.1.7",date:"2026-06-23",en:["Worker reports are now queued for durable redelivery when the Orchestrator is offline or restarting, so completed work is not silently lost.","Cancels, dismissed workers, and queued dispatch recovery now produce clearer outcomes when work can no longer be delivered.","User input now fails honestly when the Orchestrator terminal is offline instead of being recorded as if it had been sent.","Remote access has a stricter pairing boundary: phones cannot read or approve desktop-only pairing requests through the tunnel."],zh:["当 Orchestrator 离线或重启时,worker report 现在会进入持久化重投递队列,完成的工作不会再静默丢失。","取消任务、删除 worker 和排队派单恢复路径现在会给出更明确的结果,避免无法投递的工作一直悬着。","当 Orchestrator 终端离线时,用户输入现在会真实失败,不再被记录成已经发送。","远程访问的配对边界更严格:手机端不能通过 tunnel 读取或审批只能在桌面完成的新设备配对请求。"]},{version:"2.1.6",date:"2026-06-21",en:["Hive now shows a global package-update prompt when a newer npm version is available, so upgrade visibility is not limited to the topbar.","Newly started workers send a ready status after receiving Hive startup instructions, giving the Orchestrator a clearer signal that the member actually came online.","The Orchestrator pane no longer exposes a stop button in its chrome, reducing accidental shutdowns of the central coordinator.","Action Center now opens as a dedicated drawer with live workspace health, attention items, recent activity, and worker selection instead of a compact popover."],zh:["检测到新的 npm 版本时,Hive 现在会显示全局更新提示,不再只依赖顶部栏的小提示。","新启动的成员收到 Hive 启动指令后会主动发送 ready 状态,让 Orchestrator 更清楚成员已经真正上线。","Orchestrator 面板不再显示关闭按钮,降低误关中央协调者的风险。","Action Center 改为专用抽屉面板,集中展示 workspace 健康状态、待关注事项、最近动态和成员选择,不再使用紧凑 popover。"]},{version:"2.1.5",date:"2026-06-21",en:["Team memory is more ambient: the Memory drawer no longer asks you to review candidates, while active memory, archived entries, and Dream history stay available for audit.","Hive can now keep lightweight user preferences separately from workspace project facts, so personal working style does not pollute team knowledge.","Workflow and skill memories can point to structured procedure references instead of copying long instructions into memory text.","Dispatch memory retrieval is stricter about relevance, avoiding unrelated role-only matches when a worker receives a new task.","Dream consolidation can run in the background with transactional apply, source checks, isolated failures, and one-step revert."],zh:["团队记忆更低打扰:Memory 抽屉不再让你处理候选记忆,但 active 记忆、归档项和 Dream 历史仍可审计。","Hive 现在可以把轻量用户偏好与 workspace 项目事实分开保存,个人工作风格不会污染团队知识。","流程和 skill 类记忆可以引用结构化 procedure,不再把长流程说明直接塞进记忆正文。","派单记忆检索更严格,只在任务相关时注入,避免仅因 worker 角色匹配就带入无关记忆。","Dream 整理可在后台完成,带事务 apply、source window 校验、失败隔离和一键回滚。"]},{version:"2.1.4",date:"2026-06-21",en:["The first workspace screen is quieter: Hive no longer pushes an Orchestrator dispatch prompt before you have a concrete task.","Team activity is easier to scan, with dispatch pulse effects and queue-count badges removed from the visible UI.","The collapsed empty-workspace sidebar no longer shows a stray compact add button.","Maintainer release checks now use a faster package-focused default gate, with the full test gate still available for high-risk releases."],zh:["第一个 workspace 页面更安静:在你还没有明确任务前,Hive 不再主动提示 Orchestrator 派发工作。","团队动态更好扫读:可见 UI 里的派单脉冲和排队数量徽标已移除。","空 workspace 的折叠侧栏不再出现孤立的紧凑添加按钮。","维护者发布检查改为默认使用更快的打包发版闸门;高风险发版仍保留完整测试闸门。"]},{version:"2.1.3",date:"2026-06-18",en:["Hive now waits when first-run CLI setup screens are visible, so startup instructions no longer collide with trust, login, or confirmation prompts.","User input reports a real delivery failure if the Orchestrator terminal is offline.","Built-in role contracts and scenario/spawn defaults are language-aware, so English workspaces receive English worker prompts by default.","The demo is now a local self-running Hive replay with task progress, worker state changes, and team dispatch flow instead of an external video.","Release checks include a local CLI compatibility report for native modules and Tier-1 agent CLIs.","Settings now shows local-only retention diagnostics, and Memory keeps ambient Dream-maintained workspace knowledge without a candidate review surface."],zh:["首次运行 CLI 出现信任、登录或确认提示时,Hive 现在会等待,不再把启动指令盲注入到 onboarding 屏幕里。","如果 Orchestrator 终端已离线,用户输入会明确返回投递失败,而不是假装成功。","内置角色契约和场景/派生成员默认值已支持语言感知,英文 workspace 默认收到英文 worker prompt。","Demo 改成本地自运行 Hive replay,直接展示任务进度、worker 状态变化和团队派单流,不再依赖外部视频。","发布检查新增本地 CLI 兼容报告,覆盖原生模块和 Tier-1 agent CLI。","Settings 增加本地留存诊断;Memory 保持由 Dream 维护的低打扰工作区知识,不再展示人工复核入口。"]},{version:"2.1.2",date:"2026-06-16",en:["Newly spawned workers now wake correctly for their first team send instead of leaving the task parked in the stopped queue.","If a spawned worker is later stopped manually, Hive still keeps the normal queued-task behavior until you start that worker again.","Claude Code sessions on Windows are more tolerant of large Hive startup and dispatch injections, reducing premature submit or leftover input."],zh:["新建的 worker 现在会正确接住第一次 team send,不会把任务停在 stopped 队列里。","如果这个 worker 后续被手动停止,Hive 仍会保留正常的排队语义:任务等你再次启动该 worker 后再投递。","Windows 上的 Claude Code 会更稳地处理大段 Hive 启动与派单注入,减少过早回车或输入残留。"]},{version:"2.1.1",date:"2026-06-14",en:["Codex terminal input is smoother and more reliable when prompts are pasted or injected for an agent.","Action Center layout and interaction details are cleaner on narrow and mobile-sized screens."],zh:["Codex 终端在粘贴或注入 prompt 时输入更顺、更可靠。","活动中心在窄屏和手机尺寸下的布局与交互细节更干净。"]},{version:"2.1.0",date:"2026-06-13",en:["New Sentinel role: a read-only patrol member that watches the team and flags stalled or orphaned work, without taking dispatches or editing memory itself.","One-click scenario team assembly — spin up a ready-made team from a preset instead of adding members one by one.",'Team memory "Dream" consolidation now runs through your Orchestrator where you can see and review it, instead of a hidden background pass. Workers can be asked to review proposed changes, but only the Orchestrator commits them — and every run can be reverted in one step.',"Action Center adds a one-click copyable team recap and a diagnostics bundle, so sharing status and getting support is faster.","Dispatch pulse: a team send now visibly flows from the Orchestrator to the worker, so you can watch work being handed off.","The add-workspace dialog now guides you to install any missing CLI before you start.","More reliable dispatching: queued tasks replay when a worker starts, delivery failures notify the issuer instead of being lost, and team list shows open dispatches.","Remote/mobile fixes: large uploads over the tunnel no longer fail, and terminal scrolling is restored for CLIs launched through wrapper or legacy commands (such as Codex on Windows).","Hardened prompts and workflow runtime against prompt-injection, with clearer protocol errors and onboarding."],zh:["新增 Sentinel 巡检角色:只读巡检成员,盯团队进度、提示停滞或孤儿任务,自己不接派单、不改记忆。","一键场景组队:从预设模板直接拉起一支现成团队,不用逐个添加成员。","团队记忆 Dream 整理改为经由 Orchestrator 执行,你能看到也能复核,不再后台静默处理。可让 worker 协助评审建议,但只有 Orchestrator 能提交,且每次整理都可一键回滚。","活动中心新增一键复制团队战报与诊断信息包,分享状态、寻求支持更快。","派单脉冲:team send 现在会从蜂后可视化地流向工蜂,派单交接一目了然。","添加 workspace 时,若缺少对应 CLI 会引导你先安装。","派单更可靠:worker 启动时重放排队任务、投递失败会通知发起方而不再丢失、team list 会列出未完成派单。","远程/移动端修复:隧道大文件上传不再失败;经包装或旧版命令启动的 CLI(如 Windows 上的 Codex)终端滚动已恢复。","强化了提示词与 workflow 运行时对提示注入的防护,协议报错与新手引导更清晰。"]},{version:"2.0.2",date:"2026-06-10",en:["Windows Codex terminals now keep the Codex-specific wheel scrolling behavior even when an older saved launch command points through node.exe and @openai/codex/bin/codex.js."],zh:["Windows 上的 Codex 终端滚轮修复:即使旧配置还通过 node.exe 和 @openai/codex/bin/codex.js 启动,Hive 也会继续使用 Codex 专用的滚轮翻页行为。"]},{version:"2.0.1",date:"2026-06-09",en:["Team memory is now available: Hive can keep useful workspace context and bring back prior decisions, constraints, and project notes when your team needs them.","The Memory and Workflows drawers have cleaner desktop and mobile layouts, clearer tabs, and a search field that stays out of the way on wide screens.","Worker cards are easier to scan, with clearer status styling, higher contrast, cleaner role text, and in-place rename instead of a separate edit dialog.","Pending dispatch status is clearer while the Orchestrator is coordinating queued or waiting worker activity.","The current remote/mobile build is now published under the original official @tt-a1i/hive package name."],zh:["团队记忆上线:Hive 可以保留有用的 workspace 上下文,并在团队需要时重新带回之前的决策、约束和项目笔记。","Memory 和 Workflows 抽屉做了桌面端与移动端布局优化,tab 更清楚,宽屏上的搜索框也更不挡内容。","Worker 卡片更容易扫读:状态样式更清晰、对比度更高、角色文字更干净,并改成卡片内直接重命名。","Orchestrator 协调排队或等待中的 worker 活动时,pending dispatch 状态显示更明确。","当前远程访问和移动端构建已通过原来的官方 @tt-a1i/hive 包名发布。"]},{version:"2.0.0",date:"2026-06-07",en:["Remote access is here, off by default: open your running Hive from a phone browser over an end-to-end encrypted tunnel, with the same authority as your local desktop browser.","The new gateway handles identity and routing only. It supports GitHub/Google sign-in, version-pinned mobile bundles, and self-hosting; your agents, terminals, workspaces, and project data stay on your computer.","Pairing is desktop-confirmed: create a short-lived pairing code on the computer, enter it on the phone, compare the 6-digit SAS code on both screens, then confirm on the desktop before the device is trusted.","Manage paired devices from Settings or the CLI: list devices, revoke one, drop a live remote session, and review the audit trail for remote requests and denials.","New CLI commands: hive remote login / status / logout / devices / revoke link the machine to a gateway account and manage trusted devices from the host.","The phone UI is the same Hive reflowed for a small screen: sign-in and machine selection, bottom navigation, workspace switching, full-screen Team / Tasks panels, reconnect banners, and update prompts.","Mobile terminals are writable directly in xterm. Worker terminals open full-screen, focus mode hides surrounding chrome while you work, and touch scrolling is smoother for shell output and faster in full-screen TUI agents.","Local-first behavior stays intact: Hive still works on 127.0.0.1 without any gateway, the tunnel is limited to Hive /api/* and /ws/*, and phones cannot approve new devices or turn Remote access back on."],zh:["远程访问上线,默认关闭:用手机浏览器通过端到端加密隧道打开正在本机运行的 Hive,权限与本地桌面浏览器等同。","新网关只做身份和路由:支持 GitHub / Google 登录、按版本固定的手机端 bundle、以及 self-host;Agent、终端、Workspace 和项目数据都留在你的电脑上。","配对必须由桌面确认:电脑生成短时配对码,手机输入后,两边显示同一个 6 位 SAS 短码;只有在电脑上确认后,新设备才会被信任。","可以在 Settings 或 CLI 里管理已配对设备:查看列表、吊销设备、立即断开正在连接的远程会话,并查看远程请求和拒绝记录的审计流水。","新增 CLI:hive remote login / status / logout / devices / revoke,可在本机完成网关联动和受信设备管理。","手机 UI 是同一个 Hive 的小屏重排:登录与机器选择、底部导航、Workspace 切换、全屏 Team / Tasks 面板、重连提示和更新提示。","移动端终端可以直接在 xterm 里输入。成员终端全屏打开,focus mode 会隐藏周边 chrome;shell 输出滚动更顺,全屏 TUI agent 里的触摸滚动也更跟手。","本地优先不变:没有网关时 Hive 仍照常运行在 127.0.0.1;隧道只允许访问 Hive 自己的 /api/* 和 /ws/*;手机不能批准新设备,也不能在关闭远程后自行重新开启。"]},{version:"1.7.0",date:"2026-06-05",en:["Hermes is now a built-in CLI agent preset alongside Claude Code, Codex, OpenCode, and Gemini — usable as Orchestrator or Worker, via team spawn --cli hermes, and in workflows.","Hermes sessions survive crashes: Hive captures the session id from the CLI startup output and resumes with --resume on restart.","Existing installs get the new preset automatically — just have hermes on your PATH."],zh:["Hermes 成为第五个内置 CLI agent preset,与 Claude Code、Codex、OpenCode、Gemini 并列 —— 可当 Orchestrator 或 Worker,支持 team spawn --cli hermes 和 workflow。","Hermes 会话可在崩溃后恢复:Hive 从 CLI 启动输出捕获 session id,重启时用 --resume 续上。","已有安装会自动获得新 preset —— 只要 PATH 里有 hermes 即可。"]},{version:"1.6.0",date:"2026-06-02",en:["A Stop button on the running Orchestrator lets you halt a runaway agent straight from the UI.","Worker cards now show queue depth and the latest activity line, and the working badge explains that Hive does not auto-detect stalls — check the terminal.","Worker reports are no longer lost when the Orchestrator is down or restarting; they are queued and redelivered automatically.","Deliberately stopping and restarting the Orchestrator no longer replays a stale crash-recovery handover.","A new completion webhook can POST to a URL you choose (Slack, ntfy, Feishu, …) when a worker reports or a workflow finishes.","Workflow agent() gains opt-in structured output via outputSchema, and the new team next lists tasks unblocked by [needs:] dependencies in tasks.md."],zh:["运行中的 Orchestrator 面板新增 Stop 按钮,可以直接在 UI 里停掉跑飞的 agent。","Worker 卡片现在显示队列数和最近活动行;working 状态会说明 Hive 不会自动检测卡死 —— 以终端为准。","Orchestrator 掉线或重启时,Worker 的汇报不再丢失,会自动排队并补投。","手动停止后再重启 Orchestrator,不会再灌入陈旧的崩溃恢复接管。","新增完成通知 Webhook:Worker 汇报或 Workflow 完成时,向你设置的 URL POST(可接 Slack、ntfy、飞书等)。","Workflow 的 agent() 支持 outputSchema 结构化输出;新增 team next 可列出 tasks.md 里被 [needs:] 解除阻塞、当前可做的任务。"]},{version:"1.5.0",date:"2026-05-31",en:["Experimental Workflows let the Orchestrator run multi-agent plans across real Hive workers, with run details, logs, stop controls, and schedules in the Workflows drawer.","Workflow-created agents can now follow your selected default CLI and allowed CLI policy instead of always falling back to Claude Code.","Experimental auto-staff can let the Orchestrator size the worker roster to the task and create task-scoped coders, testers, or reviewers.","Codex dispatches stay reliable for long pasted tasks, while short worker reports now submit quickly instead of waiting several seconds in the input box.","Runtime hardening covers malformed WebSocket frames, Windows Codex startup paths, and workflow worker cleanup edge cases."],zh:["实验性的 Workflows 可以让 Orchestrator 用真实 Hive Worker 执行多 Agent 计划,并在 Workflows 抽屉里查看详情、日志、停止控制和定时任务。","Workflow 创建的 Agent 现在会遵守你选择的默认 CLI 和允许列表,不再总是回退到 Claude Code。","实验性的自动组队可以让 Orchestrator 按任务规模创建临时 coder、tester 或 reviewer。","Codex 的长任务粘贴仍保持可靠;短的 Worker 汇报现在会快速提交,不再在输入框里等好几秒。","运行时加固覆盖了异常 WebSocket 帧、Windows Codex 启动路径和 Workflow Worker 清理等边界情况。"]},{version:"1.4.4",date:"2026-05-30",en:["Windows .cmd and .bat startup commands now launch reliably, including quoted nvm4w and Program Files paths.","Worker shutdown is more robust on Windows, with process-tree cleanup before PTY termination.","Folder picking, filesystem browsing, editor launch, hive update, and port recovery are friendlier on Windows.","Task files keep CRLF line endings, and the watcher handles atomic-save editors more gracefully."],zh:["Windows 上的 .cmd / .bat 启动命令更可靠,包括带引号的 nvm4w 和 Program Files 路径。","Windows 下 Worker 关闭更稳,会先清理进程树再终止 PTY。","文件夹选择、文件浏览、编辑器打开、hive update 和端口占用恢复在 Windows 上更顺手。","任务文件会保留 CRLF 换行,watcher 对原子保存编辑器也更宽容。"]}],db=t=>{const[a="",o=""]=t.split("-",2),[i=0,l=0,u=0]=a.split(".").map(f=>Number.parseInt(f,10)||0);return{core:[i,l,u],prerelease:o}},Af=(t,a)=>{const o=db(t),i=db(a);for(let l=0;l<3;l+=1){const u=(o.core[l]??0)-(i.core[l]??0);if(u!==0)return u}return o.prerelease===i.prerelease?0:o.prerelease?i.prerelease?o.prerelease.localeCompare(i.prerelease,void 0,{numeric:!0}):-1:1},LO=(t,a,o=MO)=>{if(a===null)return{show:!1,entries:[],seedOnly:!0};if(Af(t,a)<=0)return{show:!1,entries:[],seedOnly:!1};const i=o.filter(l=>Af(l.version,a)>0&&Af(l.version,t)<=0);return i.length===0?{show:!1,entries:[],seedOnly:!0}:{show:!0,entries:i,seedOnly:!1}},Ox="hive.last-seen-version",zO="1.7.0",HO=(t,a)=>{try{const o=window.localStorage.getItem(Ox);return o||(a?zO:null)}catch{return t}},fb=t=>{try{window.localStorage.setItem(Ox,t)}catch{}},BO=({hasExistingWorkspace:t,wizardOpen:a})=>{const o=Vm,[i,l]=y.useState(void 0);y.useEffect(()=>{i!==void 0||t===null||l(HO(o,t))},[t,i]);const u=y.useMemo(()=>i===void 0?{show:!1,entries:[],seedOnly:!1}:LO(o,i),[i]),[f,p]=y.useState(!1);y.useEffect(()=>{u.seedOnly&&fb(o)},[u.seedOnly]);const g=y.useCallback(()=>{fb(o),p(!0)},[]);return{open:u.show&&!f&&!a,entries:u.entries,close:g}},mb="hive.first-run-seen",UO=()=>{const[t,a]=y.useState(()=>{try{return window.localStorage.getItem(mb)==="1"}catch{return!0}}),o=y.useCallback(()=>{try{window.localStorage.setItem(mb,"1")}catch{}a(!0)},[]);return{seen:t,markSeen:o}},WO=t=>{const{seen:a,markSeen:o}=UO(),[i,l]=y.useState(!1);y.useEffect(()=>{!a&&t!==null&&t.length===0&&l(!0)},[a,t]);const u=y.useCallback((f=!0)=>{f&&o(),l(!1)},[o]);return{wizardOpen:i,closeWizard:u}},pb=(t,a)=>t.findIndex(i=>i.id===a.id)===-1?[...t,a]:t.map(i=>i.id===a.id?a:i),Dx=t=>t==="codex"?"codex":t==="grok"?"grok":t==="opencode"?"opencode":"default",hb=(t,a)=>Dx(t.find(o=>o.id===a)?.commandPresetId),Hl=t=>t instanceof Error?t.message:String(t),IO=({activeWorkspaceId:t,onWorkerDeleted:a,onWorkerStartFailed:o,onWorkerRunStarted:i,onWorkerRunClosed:l,setWorkersByWorkspaceId:u,workers:f})=>{const{language:p}=Se(),g=y.useCallback(async({commandPresetId:S,name:E,role:w,roleDescription:C,startupCommand:T})=>{if(!t)return{error:"No active workspace",runId:null};const N=T.trim(),A=await fN(t,{autostart:!1,command_preset_id:S||null,description:C.trim(),name:E,role:w,startup_command:N||null,ui_language:p});u(O=>({...O,[t]:pb(O[t]??[],{...A.worker,status:"idle"})}));const j=t;return Vs(j,A.worker.id).then(O=>{i?.({agentId:A.worker.id,agentName:A.worker.name,runId:O.runId,terminalInputProfile:Dx(S),workspaceId:j})}).catch(O=>{const D=Hl(O);console.error("[hive] swallowed:createWorker.start",O),u(L=>({...L,[j]:pb(L[j]??[],{...A.worker,status:"stopped"})})),o?.(D)}),{error:null,runId:null}},[t,p,i,o,u]),m=y.useCallback(async S=>{if(!t)throw new Error("No active workspace");await pN(t,S),u(E=>({...E,[t]:(E[t]??[]).filter(w=>w.id!==S)})),a?.(t,S)},[t,a,u]),b=y.useCallback(async S=>{if(!t)return{error:"No active workspace",runId:null};try{const E=await Vs(t,S);return i?.({agentId:S,agentName:S,runId:E.runId,terminalInputProfile:hb(f,S),workspaceId:t}),{error:null,runId:E.runId}}catch(E){return{error:Hl(E),runId:null}}},[t,i,f]),v=y.useCallback(async S=>{if(!t)return{error:"No active workspace"};try{return await Jl(S),l?.(t,S),{error:null}}catch(E){return{error:Hl(E)}}},[t,l]),k=y.useCallback(async(S,E)=>{if(!t)return{error:"No active workspace",runId:null};try{const w=await GT(t,S,E);return l?.(t,E),i?.({agentId:S,agentName:S,runId:w.runId,terminalInputProfile:hb(f,S),workspaceId:t}),{error:null,runId:w.runId}}catch(w){return{error:Hl(w),runId:null}}},[t,l,i,f]);return{createWorker:g,deleteWorker:m,startWorker:b,stopWorkerRun:v,restartWorkerRun:k}},Xm={mac:["vscode","vscode-insiders","cursor","finder","terminal","ghostty","zed"],windows:["vscode","vscode-insiders","cursor","finder","zed"],linux:["vscode","vscode-insiders","cursor","finder","zed"],other:["vscode","vscode-insiders","finder"]},qO=new Set(Xm.mac),PO=t=>typeof t=="string"&&qO.has(t),Mx=(t,a)=>Xm[a].includes(t),Lx=t=>t==="mac"||t==="windows"||t==="linux"?"finder":"vscode",FO="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='%23FFFFFF'%20d='M11.503.131%201.891%205.678a.84.84%200%200%200-.42.726v11.188c0%20.3.162.575.42.724l9.609%205.55a1%201%200%200%200%20.998%200l9.61-5.55a.84.84%200%200%200%20.42-.724V6.404a.84.84%200%200%200-.42-.726L12.497.131a1.01%201.01%200%200%200-.996%200M2.657%206.338h18.55c.263%200%20.43.287.297.515L12.23%2022.918c-.062.107-.229.064-.229-.06V12.335a.59.59%200%200%200-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23'/%3e%3c/svg%3e",Rf="data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='5'%20y='13'%20width='54'%20height='40'%20rx='8'%20fill='%23F2B73B'/%3e%3cpath%20d='M5%2021C5%2016.58%208.58%2013%2013%2013H25.2C27.2%2013%2029.1%2013.94%2030.3%2015.54L33.2%2019.4H51C55.42%2019.4%2059%2022.98%2059%2027.4V31H5V21Z'%20fill='%23FFD565'/%3e%3cpath%20d='M8%2027H56C58.76%2027%2061%2029.24%2061%2032V49C61%2051.76%2058.76%2054%2056%2054H8C5.24%2054%203%2051.76%203%2049V32C3%2029.24%205.24%2027%208%2027Z'%20fill='%23F8C344'/%3e%3cpath%20d='M8%2032C8%2030.9%208.9%2030%2010%2030H54C55.1%2030%2056%2030.9%2056%2032V48C56%2049.1%2055.1%2050%2054%2050H10C8.9%2050%208%2049.1%208%2048V32Z'%20fill='%23F4B43B'/%3e%3cpath%20d='M10%2031H54C55.1%2031%2056%2031.9%2056%2033V36H8V33C8%2031.9%208.9%2031%2010%2031Z'%20fill='%23FFE082'/%3e%3cpath%20d='M12%2037H52C53.1%2037%2054%2037.9%2054%2039V47C54%2048.1%2053.1%2049%2052%2049H12C10.9%2049%2010%2048.1%2010%2047V39C10%2037.9%2010.9%2037%2012%2037Z'%20fill='%23F0A82F'/%3e%3c/svg%3e",zx="/assets/finder-C4Jmsb0B.png",KO="/assets/ghostty-D-Js4rdm.png",YO="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='24'%20height='24'%20rx='4'%20fill='%232D2D2E'/%3e%3cpath%20d='M6.5%209%20L10%2012%20L6.5%2015'%20stroke='%23FFFFFF'%20stroke-width='1.7'%20fill='none'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cline%20x1='12.5'%20y1='15.5'%20x2='17.5'%20y2='15.5'%20stroke='%23FFFFFF'%20stroke-width='1.7'%20stroke-linecap='round'/%3e%3c/svg%3e",$O="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%23007ACC'%20d='M22%205.75v12.48c0%20.49-.28.94-.72%201.15-.91.43-2.46%201.18-3.33%201.59.03-.16.05-.33.05-.5V3.53C18%203.3%2017.97%203.12%2017.94%203c.94.46%202.44%201.18%203.33%201.6C21.72%204.81%2022%205.26%2022%205.75zM3.91%2013.35c.89.8%201.73%201.56%202.51%202.28l-1.48%201.12c-.37.28-.89.27-1.25-.03l-.94-.79c-.46-.39-.48-1.09-.03-1.5C3.05%2014.13%203.46%2013.76%203.91%2013.35zM16%203.53v4.81l-3.16%202.4-3.3-2.5c2.29-2.07%204.46-4.05%205.59-5.1.23-.22.56-.16.74.04.05.06.09.13.11.22C15.99%203.44%2016%203.48%2016%203.53zM16%2020.47v-4.81L4.938%207.252c-.372-.283-.889-.27-1.247.03L2.754%208.066C2.289%208.456%202.271%209.162%202.72%209.569c2.747%202.488%209.998%209.06%2012.41%2011.291C15.462%2021.167%2016%2020.93%2016%2020.47z'/%3e%3c/svg%3e",VO="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%2324BFA5'%20d='M22%205.75v12.48c0%20.49-.28.94-.72%201.15-.91.43-2.46%201.18-3.33%201.59.03-.16.05-.33.05-.5V3.53C18%203.3%2017.97%203.12%2017.94%203c.94.46%202.44%201.18%203.33%201.6C21.72%204.81%2022%205.26%2022%205.75zM3.91%2013.35c.89.8%201.73%201.56%202.51%202.28l-1.48%201.12c-.37.28-.89.27-1.25-.03l-.94-.79c-.46-.39-.48-1.09-.03-1.5C3.05%2014.13%203.46%2013.76%203.91%2013.35zM16%203.53v4.81l-3.16%202.4-3.3-2.5c2.29-2.07%204.46-4.05%205.59-5.1.23-.22.56-.16.74.04.05.06.09.13.11.22C15.99%203.44%2016%203.48%2016%203.53zM16%2020.47v-4.81L4.938%207.252c-.372-.283-.889-.27-1.247.03L2.754%208.066C2.289%208.456%202.271%209.162%202.72%209.569c2.747%202.488%209.998%209.06%2012.41%2011.291C15.462%2021.167%2016%2020.93%2016%2020.47z'/%3e%3c/svg%3e",GO="/assets/zed-C5BQT8X3.png",XO={mac:"openWorkspace.target.finder.mac",windows:"openWorkspace.target.finder.windows",linux:"openWorkspace.target.finder.linux",other:"openWorkspace.target.finder.linux"},ZO={mac:zx,windows:Rf,linux:Rf,other:Rf},Oc={vscode:{labelKey:"openWorkspace.target.vscode",iconSrc:$O},"vscode-insiders":{labelKey:"openWorkspace.target.vscodeInsiders",iconSrc:VO},cursor:{labelKey:"openWorkspace.target.cursor",iconSrc:FO},finder:{labelKey:"openWorkspace.target.finder.mac",iconSrc:zx},terminal:{labelKey:"openWorkspace.target.terminal",iconSrc:YO},ghostty:{labelKey:"openWorkspace.target.ghostty",iconSrc:KO,iconScale:1.2},zed:{labelKey:"openWorkspace.target.zed",iconSrc:GO}},Hx=(t,a)=>t==="finder"?XO[a]:Oc[t].labelKey,Bx=(t,a)=>t==="finder"?ZO[a]:Oc[t].iconSrc,Of=(t,a)=>{const o=Mx(t,a)?t:Lx(a),i=Oc[o];return{id:o,iconSrc:Bx(o,a),labelKey:Hx(o,a),...i.iconScale!==void 0?{iconScale:i.iconScale}:{}}},QO=t=>Xm[t].map(a=>{const o=Oc[a];return{id:a,iconSrc:Bx(a,t),labelKey:Hx(a,t),...o.iconScale!==void 0?{iconScale:o.iconScale}:{}}}),JO=()=>{if(typeof navigator>"u")return"other";const t=`${navigator.userAgent} ${navigator.platform}`.toLowerCase();return t.includes("mac")||t.includes("darwin")?"mac":t.includes("win")?"windows":t.includes("linux")||t.includes("x11")?"linux":"other"},Ux="hive.openTarget.preferred",e5=()=>{try{return window.localStorage.getItem(Ux)}catch{return null}},t5=t=>{const a=Lx(t);if(typeof window>"u")return a;const o=e5();if(!o)return a;const i=o==="ghostie"?"ghostty":o;return PO(i)&&Mx(i,t)?i:a},n5=t=>{try{window.localStorage.setItem(Ux,t)}catch{}},a5={"app-not-installed":"openWorkspace.error.appNotInstalled","command-not-in-path":"openWorkspace.error.commandNotInPath","invalid-path":"openWorkspace.error.invalidPath","invalid-target":"openWorkspace.error.invalidTarget",unknown:"openWorkspace.error.unknown"},r5=({workspace:t})=>{const{t:a}=Se(),{mode:o}=ow(),i=tn(),l=y.useMemo(()=>JO(),[]),u=QO(l),[f,p]=y.useState(()=>t5(l)),[g,m]=y.useState(!1),[b,v]=y.useState(!1),k=y.useRef(null),S=y.useRef(null),E=Of(f,l),w=a(E.labelKey);y.useEffect(()=>{if(!g)return;const D=q=>{q.key==="Escape"&&m(!1)},L=q=>{const $=k.current;$&&!$.contains(q.target)&&m(!1)};return document.addEventListener("keydown",D),document.addEventListener("pointerdown",L),()=>{document.removeEventListener("keydown",D),document.removeEventListener("pointerdown",L)}},[g]);const C=y.useCallback(D=>{p(D),n5(D),m(!1),S.current?.focus()},[]),T=y.useCallback(async()=>{if(!(!t||b)){v(!0);try{const D=await vN(t.id,f);if(D.ok){if(o==="mobile"){const L=Of(D.effectiveTargetId,l).labelKey;i.show({kind:"success",message:a("openWorkspace.opened",{app:a(L),workspace:t.name})})}}else{const L=Of(D.effectiveTargetId,l).labelKey;i.show({kind:"error",message:a(a5[D.errorCode],{app:a(L)})})}}catch(D){const L=D instanceof Error?D.message:String(D);i.show({kind:"error",message:L})}finally{v(!1)}}},[b,o,l,f,a,i,t]),N=!t,A=a("openWorkspace.noWorkspace"),j=t?a("openWorkspace.openIn",{app:w,workspace:t.name}):A,O=t?a("openWorkspace.openInAria",{app:w,workspace:t.name}):A;return c.jsxs("div",{ref:k,className:"open-workspace relative flex",children:[c.jsx(et,{label:j,children:c.jsx("span",{className:"flex",children:c.jsxs("button",{ref:S,type:"button","aria-label":O,"data-testid":"topbar-open-workspace",disabled:N||b,onClick:()=>{T()},className:"open-workspace__main",children:[c.jsx("span",{className:"open-workspace__trigger-icon","aria-hidden":!0,children:b?c.jsx(Va,{size:13,className:"animate-spin"}):c.jsx("img",{src:E.iconSrc,alt:"",className:"open-workspace__trigger-img",style:{transform:E.iconScale?`scale(${E.iconScale})`:void 0}})}),c.jsx("span",{children:a("openWorkspace.open")})]})})}),c.jsx(et,{label:a("openWorkspace.selectTarget"),children:c.jsx("button",{type:"button","aria-label":a("openWorkspace.selectTarget"),"aria-haspopup":"menu","aria-expanded":g,"data-testid":"topbar-open-workspace-chevron",disabled:N,onClick:()=>m(D=>!D),className:"open-workspace__chevron",children:c.jsx(_o,{size:12,"aria-hidden":!0})})}),g?c.jsx("div",{role:"menu","aria-label":a("openWorkspace.selectTarget"),className:"open-workspace__menu elev-2","data-testid":"topbar-open-workspace-menu",children:u.map(D=>{const L=D.id===f;return c.jsxs("button",{role:"menuitemradio","aria-checked":L,type:"button",onClick:()=>C(D.id),className:"open-workspace__option","data-selected":L?"true":void 0,"data-testid":`topbar-open-workspace-option-${D.id}`,children:[c.jsx("span",{className:"open-workspace__option-icon","aria-hidden":!0,children:c.jsx("img",{src:D.iconSrc,alt:"",className:"open-workspace__option-img",style:{transform:D.iconScale?`scale(${D.iconScale})`:void 0}})}),c.jsx("span",{className:"flex-1",children:a(D.labelKey)}),c.jsx("span",{className:"open-workspace__check","aria-hidden":!0,children:L?c.jsx(Ja,{size:13}):null})]},D.id)})}):null]})},o5=y.lazy(()=>Nt(()=>import("./WorkflowsDrawer-Bk87nnDw.js"),__vite__mapDeps([5,4])).then(t=>({default:t.WorkflowsDrawer}))),s5=y.lazy(()=>Nt(()=>import("./WorkspaceMemoryDrawer-DPfFpEwj.js"),__vite__mapDeps([6,3])).then(t=>({default:t.WorkspaceMemoryDrawer}))),i5=()=>{const[t,a]=y.useState(null),{activeWorkspaceId:o,selectWorkspace:i,setActiveWorkspaceId:l}=u4(),{demoMode:u,enableDemo:f,exitDemo:p}=gR(),g=u||!t?[]:t.map(({id:we})=>we),[m,b]=g4(g,{activeWorkspaceId:o}),[v,k]=y.useState(0),[S,E]=y.useState(!1),[w,C]=y.useState(!1),[T,N]=y.useState(!1),[A,j]=y.useState(null),[O,D]=y.useState("team"),L=qR(),q=tn(),$=yx(),{wizardOpen:ae,closeWizard:G}=WO(t),W=BO({hasExistingWorkspace:t===null?null:t.length>0,wizardOpen:ae}),Q=hx().enabled;y.useEffect(()=>{Q||(N(!1),D(we=>we==="flows"?"team":we))},[Q]);const V=y.useCallback(()=>k(we=>we+1),[]),[M,P]=y.useState(null),I=y.useCallback(we=>{P(we),q.show({kind:"error",message:we})},[q]);o4(a,l,I);const F=vR({demoMode:u,workspaces:t,activeWorkspaceId:o,workersByWorkspaceId:m}),R=F.effectiveActiveWorkspace?.id,B=R?F.effectiveWorkersByWorkspaceId[R]??[]:[];y.useEffect(()=>{j(we=>we&&B.some(at=>at.id===we)?we:null)},[B]);const se=hA(F.pollWorkspaceId),te=q3(F.pollWorkspaceId,se,B),fe=i4({onWorkspaceCreated:we=>{a(at=>at===null?[we]:[...at,we]),i(we.id),b(at=>({...at,[we.id]:[]}))},onError:we=>q.show({kind:"error",message:we}),onOrchestratorRunStarted:(we,at)=>te.recordOptimisticRun({agentId:Ym(we),agentName:"Orchestrator",runId:at,status:"starting",workspaceId:we})});p3(!0);const me=I3(u?null:o??null,u?hR:void 0),ue=y.useMemo(()=>F.effectiveActiveWorkspace?M3(me.content):0,[F.effectiveActiveWorkspace,me.content]),ie=IO({activeWorkspaceId:o,onWorkerDeleted:te.forgetOptimisticAgent,onWorkerRunClosed:te.forgetOptimisticRun,onWorkerStartFailed:we=>q.show({kind:"error",message:we}),onWorkerRunStarted:te.recordOptimisticRun,setWorkersByWorkspaceId:b,workers:B}),le=c4({activeWorkspaceId:o,onActiveDeleted:()=>{C(!1),E(!1),N(!1)},selectWorkspace:i,setWorkersByWorkspaceId:b,setWorkspaces:a,workspaces:t});e4({bootstrapError:M,onSelectWorkspace:i,onTriggerAddDialog:V,workspaces:F.effectiveWorkspaces}),E3({onAddWorkspace:V,onTryDemo:f,ready:u||t!==null||M!==null});const ce=s4(),de=M!==null&&!u&&t===null,Te=xt(),xe=y.useSyncExternalStore(F3,K3),qe=Te?c.jsx(KR,{status:xe}):null,Qe=R?te.optimisticRunsByWorkspaceId[R]??[]:[],nn=!de&&!u&&R!==void 0&&(te.terminalRuns.length>0||Qe.length>0)?c.jsx(DO,{onTerminalRunExited:te.forgetOptimisticRun,optimisticRuns:Qe,terminalRuns:te.terminalRuns,workspaceId:R},`terminal-${R}`):null,an=de?c.jsx(g3,{onTryDemo:f}):c.jsx(mR,{activeId:R,activeWorkspace:F.effectiveActiveWorkspace,activeWorkerId:A,bootstrapError:M,demoMode:u,workspacesLoading:!u&&t===null,onActiveWorkerChange:j,onDeleteWorkspace:le,onExitDemo:p,onOrchestratorRunClosed:te.forgetOptimisticRun,onRequestAddWorkspace:V,onShellRunClosed:te.forgetOptimisticRun,onShellRunStarted:(we,at)=>te.recordOptimisticRun({agentId:at.agent_id,agentName:at.agent_name,runId:at.run_id,status:at.status,terminalInputProfile:at.terminal_input_profile??"default",workspaceId:we}),onTryDemo:f,orchestratorAutostartErrors:fe.orchestratorAutostartErrors,recordOrchestratorResult:fe.recordOrchestratorResult,terminalRuns:te.terminalRuns,workerActions:ie,workers:B,showInlineActionCenter:Te}),jn=c.jsx(lS,{addDialogTrigger:v,wizardOpen:ae,whatsNewOpen:W.open,whatsNewEntries:W.entries,onCloseWhatsNew:W.close,onAddWorkspace:V,onCloseTaskGraph:()=>E(!1),onCloseWizard:G,onCreateWorkspace:fe.createNewWorkspace,onTryDemo:f,taskGraphOpen:S,tasksFile:me,workspacePath:F.effectiveActiveWorkspace?.path??null,workers:B,onSelectOwner:ce}),De=T&&!u&&Q?c.jsx(y.Suspense,{fallback:null,children:c.jsx(o5,{open:!0,onClose:()=>N(!1),workspaceId:o??null})}):null,vn=w&&!u?c.jsx(y.Suspense,{fallback:null,children:c.jsx(s5,{open:!0,onClose:()=>C(!1),workspaceId:o??null})}):null,fa=c.jsx(A3,{activeWorkspaceId:F.effectiveActiveWorkspaceId,collapsed:L.collapsed,createDisabledReason:M??void 0,onCreateClick:V,onDeleteWorkspace:le,onSelectWorkspace:i,onToggleCollapse:L.toggleCollapsed,workersByWorkspaceId:F.effectiveWorkersByWorkspaceId,workspaces:F.effectiveWorkspaces}),ma=c.jsxs(c.Fragment,{children:[c.jsx(r5,{workspace:F.effectiveActiveWorkspace}),de||u||!R?null:c.jsx(U_,{workspaceId:R,onOpenWorker:j},R)]});return Te?c.jsxs(c.Fragment,{children:[c.jsx(a3,{workspaceSwitcher:de?void 0:c.jsx(c3,{activeWorkspaceId:F.effectiveActiveWorkspaceId,workspaces:F.effectiveWorkspaces,workersByWorkspaceId:F.effectiveWorkersByWorkspaceId,createDisabledReason:M??void 0,onCreateClick:V,onDeleteWorkspace:le,onSelectWorkspace:i}),topbarActions:de?void 0:c.jsx(c.Fragment,{children:c.jsx(vx,{})}),openTaskCount:ue,workingCount:B.filter(we=>we.status==="working").length,banner:qe,terminalPanels:nn,fullBleed:de?an:void 0,team:de?null:an,tasks:de?null:c.jsx(s3,{tasksFile:me,workspacePath:F.effectiveActiveWorkspace?.path??null,workers:B,onSelectOwner:ce,onAddWorkspace:V,demoMode:u}),settings:de||!u?void 0:c.jsx(GR,{demoMode:u,onTryDemo:f,onExitDemo:p}),activeSection:O,onSectionChange:D,overlays:jn}),c.jsx(nb,{versionInfo:$}),c.jsx(eb,{terminalRuns:te.terminalRuns}),c.jsx(tb,{})]}):c.jsxs(c.Fragment,{children:[c.jsxs(PR,{hideTopbarActions:!F.effectiveActiveWorkspace,memoryOpen:w,onToggleMemory:u?void 0:()=>C(we=>!we),onToggleTaskGraph:()=>E(we=>!we),openTaskCount:ue,topbarActions:ma,taskGraphOpen:S,onToggleWorkflows:u||!Q?void 0:()=>N(we=>!we),workflowsOpen:T,sidebarResize:L,sidebar:fa,versionInfo:$,children:[an,nn,jn,vn,De]}),c.jsx(nb,{versionInfo:$}),c.jsx(eb,{terminalRuns:te.terminalRuns}),c.jsx(tb,{}),c.jsx(m3,{})]})},l5={success:Xb,warning:$s,error:BS},Df={success:"var(--status-green)",warning:"var(--status-orange)",error:"var(--status-red)"},gb=({toast:t,api:a})=>{const{t:o}=Se(),i=l5[t.kind],l=a.getDuration(t.id);return c.jsxs("div",{"data-testid":"toast","data-kind":t.kind,onMouseEnter:()=>a.pauseDismiss(t.id),onMouseLeave:()=>a.resumeDismiss(t.id),className:"toast elev-2 toast-pop pointer-events-auto relative flex min-w-[260px] max-w-[400px] items-start gap-3 overflow-hidden rounded-lg border px-3 py-2.5",style:{background:"var(--bg-elevated)",borderColor:`color-mix(in oklab, ${Df[t.kind]} 35%, var(--border))`},children:[c.jsx("span",{className:"mt-0.5 shrink-0",style:{color:Df[t.kind]},"aria-hidden":!0,children:c.jsx(i,{size:14})}),c.jsx("div",{className:"min-w-0 flex-1 break-words text-sm text-pri",children:t.message}),c.jsx("button",{type:"button","data-testid":"toast-close",onClick:()=>a.dismiss(t.id),className:"-mt-0.5 -mr-1 flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded text-ter transition-colors hover:bg-3 hover:text-pri","aria-label":o("toast.dismissAria"),children:c.jsx(Ga,{size:14,"aria-hidden":!0})}),l>0?c.jsx("span",{className:"toast-progress-bar",style:{background:Df[t.kind],animationDuration:`${l}ms`},"aria-hidden":!0}):null]})},c5=()=>{const t=D_(),a=tn(),o=xt();if(t.length===0)return null;const i=t.filter(u=>u.kind==="error"),l=t.filter(u=>u.kind!=="error");return c.jsxs("div",{className:"toaster pointer-events-none fixed right-4 bottom-8 z-50 flex flex-col gap-2","data-mobile":o||void 0,"data-testid":"toaster",children:[c.jsx("div",{role:"status","aria-live":"polite",className:"flex flex-col gap-2",children:l.map(u=>c.jsx(gb,{toast:u,api:a},u.id))}),c.jsx("div",{role:"alert","aria-live":"assertive",className:"flex flex-col gap-2",children:i.map(u=>c.jsx(gb,{toast:u,api:a},u.id))})]})},u5=({children:t})=>c.jsx(Hw,{delayDuration:250,skipDelayDuration:150,children:c.jsx(aC,{children:c.jsx(O_,{children:c.jsx(V_,{children:c.jsx(MR,{children:c.jsx(OR,{children:c.jsxs(jR,{children:[t,c.jsx(c5,{})]})})})})})})}),d5=()=>c.jsx(PN,{children:c.jsx(u5,{children:c.jsx(i5,{})})}),vb="\0gw:",Sr={Unauthorized:4401,Forbidden:4403,DaemonOffline:4404,Revoked:4410,InternalError:4500},Wx="hb:ping",Ix="hb:pong",f5=t=>t===Sr.Unauthorized||t===Sr.Revoked;function m5(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}function cm(t){if(typeof t!="boolean")throw new TypeError(`boolean expected, not ${t}`)}function xo(t){if(typeof t!="number")throw new TypeError("number expected, got "+typeof t);if(!Number.isSafeInteger(t)||t<0)throw new RangeError("positive integer expected, got "+t)}function Et(t,a,o=""){const i=m5(t),l=t?.length,u=a!==void 0;if(!i||u&&l!==a){const f=o&&`"${o}" `,p=u?` of length ${a}`:"",g=i?`length=${l}`:`type=${typeof t}`,m=f+"expected Uint8Array"+p+", got "+g;throw i?new RangeError(m):new TypeError(m)}return t}function yb(t,a=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(a&&t.finished)throw new Error("Hash#digest() has already been called")}function p5(t,a,o=!1){Et(t,void 0,"output");const i=a.outputLen;if(t.length<i)throw new RangeError("digestInto() expects output buffer of length at least "+i);if(o&&!Js(t))throw new Error("invalid output, must be aligned")}function ia(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Ya(...t){for(let a=0;a<t.length;a++)t[a].fill(0)}function h5(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const Er=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,qx=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255,St=Er?t=>t:t=>qx(t)>>>0,g5=t=>{for(let a=0;a<t.length;a++)t[a]=qx(t[a]);return t},Fa=Er?t=>t:g5;function v5(t,a){if(a==null||typeof a!="object")throw new Error("options must be defined");return Object.assign(t,a)}function y5(t,a){if(t.length!==a.length)return!1;let o=0;for(let i=0;i<t.length;i++)o|=t[i]^a[i];return o===0}function b5(t,a,o){const i=a,l=(()=>[]),u=(p,g)=>i(g,...l(p)).update(p).digest(),f=i(new Uint8Array(t),...l(new Uint8Array(0)));return u.outputLen=f.outputLen,u.blockLen=f.blockLen,u.create=(p,...g)=>i(p,...g),u}const w5=(t,a)=>{function o(i,...l){if(Et(i,void 0,"key"),t.nonceLength!==void 0){const b=l[0];Et(b,t.varSizeNonce?void 0:t.nonceLength,"nonce")}const u=t.tagLength;u&&l[1]!==void 0&&Et(l[1],void 0,"AAD");const f=a(i,...l),p=(b,v)=>{if(v!==void 0){if(b!==2)throw new Error("cipher output not supported");Et(v,void 0,"output")}};let g=!1;return{encrypt(b,v){if(g)throw new Error("cannot encrypt() twice with same key + nonce");return g=!0,Et(b),p(f.encrypt.length,v),f.encrypt(b,v)},decrypt(b,v){if(Et(b),u&&b.length<u)throw new Error('"ciphertext" expected length bigger than tagLength='+u);return p(f.decrypt.length,v),f.decrypt(b,v)}}}return Object.assign(o,t),o};function um(t,a,o=!0){if(a===void 0)return new Uint8Array(t);if(Et(a,void 0,"output"),a.length!==t)throw new Error('"output" expected Uint8Array of length '+t+", got: "+a.length);if(o&&!Js(a))throw new Error("invalid output, must be aligned");return a}function x5(t,a,o){xo(t),xo(a),cm(o);const i=new Uint8Array(16),l=h5(i);return l.setBigUint64(0,BigInt(a),o),l.setBigUint64(8,BigInt(t),o),i}function Js(t){return t.byteOffset%4===0}function lc(t){return Uint8Array.from(Et(t))}function Px(t=32){xo(t);const a=typeof globalThis=="object"?globalThis.crypto:null;if(typeof a?.getRandomValues!="function")throw new Error("crypto.getRandomValues must be defined");return a.getRandomValues(new Uint8Array(t))}const Fx=t=>Uint8Array.from(t.split(""),a=>a.charCodeAt(0)),k5=Fa(ia(Fx("expand 16-byte k"))),S5=Fa(ia(Fx("expand 32-byte k")));function ge(t,a){return t<<a|t>>>32-a}const zs=64,E5=16,dm=2**32-1,bb=Uint32Array.of();function C5(t,a,o,i,l,u,f,p){const g=l.length,m=new Uint8Array(zs),b=ia(m),v=Er&&Js(l)&&Js(u),k=v?ia(l):bb,S=v?ia(u):bb;if(!Er){for(let E=0;E<g;f++){if(t(a,o,i,b,f,p),Fa(b),f>=dm)throw new Error("arx: counter overflow");const w=Math.min(zs,g-E);for(let C=0,T;C<w;C++)T=E+C,u[T]=l[T]^m[C];E+=w}return}for(let E=0;E<g;f++){if(t(a,o,i,b,f,p),f>=dm)throw new Error("arx: counter overflow");const w=Math.min(zs,g-E);if(v&&w===zs){const C=E/4;if(E%4!==0)throw new Error("arx: invalid block position");for(let T=0,N;T<E5;T++)N=C+T,S[N]=k[N]^b[T];E+=zs;continue}for(let C=0,T;C<w;C++)T=E+C,u[T]=l[T]^m[C];E+=w}}function T5(t,a){const{allowShortKeys:o,extendNonceFn:i,counterLength:l,counterRight:u,rounds:f}=v5({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},a);if(typeof t!="function")throw new Error("core must be a function");return xo(l),xo(f),cm(u),cm(o),(p,g,m,b,v=0)=>{Et(p,void 0,"key"),Et(g,void 0,"nonce"),Et(m,void 0,"data");const k=m.length;if(b=um(k,b,!1),xo(v),v<0||v>=dm)throw new Error("arx: counter overflow");const S=[];let E=p.length,w,C;if(E===32)S.push(w=lc(p)),C=S5;else if(E===16&&o)w=new Uint8Array(32),w.set(p),w.set(p,16),C=k5,S.push(w);else throw Et(p,32,"arx key"),new Error("invalid key size");(!Er||!Js(g))&&S.push(g=lc(g));let T=ia(w);if(i){if(g.length!==24)throw new Error("arx: extended nonce must be 24 bytes");const j=g.subarray(0,16);if(Er)i(C,T,ia(j),T);else{const O=Fa(Uint32Array.from(C));i(O,T,ia(j),T),Ya(O),Fa(T)}g=g.subarray(16)}else Er||Fa(T);const N=16-l;if(N!==g.length)throw new Error(`arx: nonce must be ${N} or 16 bytes`);if(N!==12){const j=new Uint8Array(12);j.set(g,u?0:12-g.length),g=j,S.push(g)}const A=Fa(ia(g));try{return C5(t,C,T,A,m,b,v,f),b}finally{Ya(...S)}}}function bt(t,a){return t[a++]&255|(t[a++]&255)<<8}class N5{blockLen=16;outputLen=16;buffer=new Uint8Array(16);r=new Uint16Array(10);h=new Uint16Array(10);pad=new Uint16Array(8);pos=0;finished=!1;destroyed=!1;constructor(a){a=lc(Et(a,32,"key"));const o=bt(a,0),i=bt(a,2),l=bt(a,4),u=bt(a,6),f=bt(a,8),p=bt(a,10),g=bt(a,12),m=bt(a,14);this.r[0]=o&8191,this.r[1]=(o>>>13|i<<3)&8191,this.r[2]=(i>>>10|l<<6)&7939,this.r[3]=(l>>>7|u<<9)&8191,this.r[4]=(u>>>4|f<<12)&255,this.r[5]=f>>>1&8190,this.r[6]=(f>>>14|p<<2)&8191,this.r[7]=(p>>>11|g<<5)&8065,this.r[8]=(g>>>8|m<<8)&8191,this.r[9]=m>>>5&127;for(let b=0;b<8;b++)this.pad[b]=bt(a,16+2*b)}process(a,o,i=!1){const l=i?0:2048,{h:u,r:f}=this,p=f[0],g=f[1],m=f[2],b=f[3],v=f[4],k=f[5],S=f[6],E=f[7],w=f[8],C=f[9],T=bt(a,o+0),N=bt(a,o+2),A=bt(a,o+4),j=bt(a,o+6),O=bt(a,o+8),D=bt(a,o+10),L=bt(a,o+12),q=bt(a,o+14);let $=u[0]+(T&8191),ae=u[1]+((T>>>13|N<<3)&8191),G=u[2]+((N>>>10|A<<6)&8191),W=u[3]+((A>>>7|j<<9)&8191),ee=u[4]+((j>>>4|O<<12)&8191),Q=u[5]+(O>>>1&8191),V=u[6]+((O>>>14|D<<2)&8191),M=u[7]+((D>>>11|L<<5)&8191),P=u[8]+((L>>>8|q<<8)&8191),I=u[9]+(q>>>5|l),Z=0,F=Z+$*p+ae*(5*C)+G*(5*w)+W*(5*E)+ee*(5*S);Z=F>>>13,F&=8191,F+=Q*(5*k)+V*(5*v)+M*(5*b)+P*(5*m)+I*(5*g),Z+=F>>>13,F&=8191;let R=Z+$*g+ae*p+G*(5*C)+W*(5*w)+ee*(5*E);Z=R>>>13,R&=8191,R+=Q*(5*S)+V*(5*k)+M*(5*v)+P*(5*b)+I*(5*m),Z+=R>>>13,R&=8191;let B=Z+$*m+ae*g+G*p+W*(5*C)+ee*(5*w);Z=B>>>13,B&=8191,B+=Q*(5*E)+V*(5*S)+M*(5*k)+P*(5*v)+I*(5*b),Z+=B>>>13,B&=8191;let se=Z+$*b+ae*m+G*g+W*p+ee*(5*C);Z=se>>>13,se&=8191,se+=Q*(5*w)+V*(5*E)+M*(5*S)+P*(5*k)+I*(5*v),Z+=se>>>13,se&=8191;let te=Z+$*v+ae*b+G*m+W*g+ee*p;Z=te>>>13,te&=8191,te+=Q*(5*C)+V*(5*w)+M*(5*E)+P*(5*S)+I*(5*k),Z+=te>>>13,te&=8191;let fe=Z+$*k+ae*v+G*b+W*m+ee*g;Z=fe>>>13,fe&=8191,fe+=Q*p+V*(5*C)+M*(5*w)+P*(5*E)+I*(5*S),Z+=fe>>>13,fe&=8191;let me=Z+$*S+ae*k+G*v+W*b+ee*m;Z=me>>>13,me&=8191,me+=Q*g+V*p+M*(5*C)+P*(5*w)+I*(5*E),Z+=me>>>13,me&=8191;let ue=Z+$*E+ae*S+G*k+W*v+ee*b;Z=ue>>>13,ue&=8191,ue+=Q*m+V*g+M*p+P*(5*C)+I*(5*w),Z+=ue>>>13,ue&=8191;let ie=Z+$*w+ae*E+G*S+W*k+ee*v;Z=ie>>>13,ie&=8191,ie+=Q*b+V*m+M*g+P*p+I*(5*C),Z+=ie>>>13,ie&=8191;let le=Z+$*C+ae*w+G*E+W*S+ee*k;Z=le>>>13,le&=8191,le+=Q*v+V*b+M*m+P*g+I*p,Z+=le>>>13,le&=8191,Z=(Z<<2)+Z|0,Z=Z+F|0,F=Z&8191,Z=Z>>>13,R+=Z,u[0]=F,u[1]=R,u[2]=B,u[3]=se,u[4]=te,u[5]=fe,u[6]=me,u[7]=ue,u[8]=ie,u[9]=le}finalize(){const{h:a,pad:o}=this,i=new Uint16Array(10);let l=a[1]>>>13;a[1]&=8191;for(let p=2;p<10;p++)a[p]+=l,l=a[p]>>>13,a[p]&=8191;a[0]+=l*5,l=a[0]>>>13,a[0]&=8191,a[1]+=l,l=a[1]>>>13,a[1]&=8191,a[2]+=l,i[0]=a[0]+5,l=i[0]>>>13,i[0]&=8191;for(let p=1;p<10;p++)i[p]=a[p]+l,l=i[p]>>>13,i[p]&=8191;i[9]-=8192;let u=(l^1)-1;for(let p=0;p<10;p++)i[p]&=u;u=~u;for(let p=0;p<10;p++)a[p]=a[p]&u|i[p];a[0]=(a[0]|a[1]<<13)&65535,a[1]=(a[1]>>>3|a[2]<<10)&65535,a[2]=(a[2]>>>6|a[3]<<7)&65535,a[3]=(a[3]>>>9|a[4]<<4)&65535,a[4]=(a[4]>>>12|a[5]<<1|a[6]<<14)&65535,a[5]=(a[6]>>>2|a[7]<<11)&65535,a[6]=(a[7]>>>5|a[8]<<8)&65535,a[7]=(a[8]>>>8|a[9]<<5)&65535;let f=a[0]+o[0];a[0]=f&65535;for(let p=1;p<8;p++)f=(a[p]+o[p]|0)+(f>>>16)|0,a[p]=f&65535;Ya(i)}update(a){yb(this),Et(a),a=lc(a);const{buffer:o,blockLen:i}=this,l=a.length;for(let u=0;u<l;){const f=Math.min(i-this.pos,l-u);if(f===i){for(;i<=l-u;u+=i)this.process(a,u);continue}o.set(a.subarray(u,u+f),this.pos),this.pos+=f,u+=f,this.pos===i&&(this.process(o,0,!1),this.pos=0)}return this}destroy(){this.destroyed=!0,Ya(this.h,this.r,this.buffer,this.pad)}digestInto(a){yb(this),p5(a,this),this.finished=!0;const{buffer:o,h:i}=this;let{pos:l}=this;if(l){for(o[l++]=1;l<16;l++)o[l]=0;this.process(o,0,!0)}this.finalize();let u=0;for(let f=0;f<8;f++)a[u++]=i[f]>>>0,a[u++]=i[f]>>>8}digest(){const{buffer:a,outputLen:o}=this;this.digestInto(a);const i=a.slice(0,o);return this.destroy(),i}}const j5=b5(32,t=>new N5(t));function _5(t,a,o,i,l,u=20){let f=t[0],p=t[1],g=t[2],m=t[3],b=a[0],v=a[1],k=a[2],S=a[3],E=a[4],w=a[5],C=a[6],T=a[7],N=l,A=o[0],j=o[1],O=o[2],D=f,L=p,q=g,$=m,ae=b,G=v,W=k,ee=S,Q=E,V=w,M=C,P=T,I=N,Z=A,F=j,R=O;for(let se=0;se<u;se+=2)D=D+ae|0,I=ge(I^D,16),Q=Q+I|0,ae=ge(ae^Q,12),D=D+ae|0,I=ge(I^D,8),Q=Q+I|0,ae=ge(ae^Q,7),L=L+G|0,Z=ge(Z^L,16),V=V+Z|0,G=ge(G^V,12),L=L+G|0,Z=ge(Z^L,8),V=V+Z|0,G=ge(G^V,7),q=q+W|0,F=ge(F^q,16),M=M+F|0,W=ge(W^M,12),q=q+W|0,F=ge(F^q,8),M=M+F|0,W=ge(W^M,7),$=$+ee|0,R=ge(R^$,16),P=P+R|0,ee=ge(ee^P,12),$=$+ee|0,R=ge(R^$,8),P=P+R|0,ee=ge(ee^P,7),D=D+G|0,R=ge(R^D,16),M=M+R|0,G=ge(G^M,12),D=D+G|0,R=ge(R^D,8),M=M+R|0,G=ge(G^M,7),L=L+W|0,I=ge(I^L,16),P=P+I|0,W=ge(W^P,12),L=L+W|0,I=ge(I^L,8),P=P+I|0,W=ge(W^P,7),q=q+ee|0,Z=ge(Z^q,16),Q=Q+Z|0,ee=ge(ee^Q,12),q=q+ee|0,Z=ge(Z^q,8),Q=Q+Z|0,ee=ge(ee^Q,7),$=$+ae|0,F=ge(F^$,16),V=V+F|0,ae=ge(ae^V,12),$=$+ae|0,F=ge(F^$,8),V=V+F|0,ae=ge(ae^V,7);let B=0;i[B++]=f+D|0,i[B++]=p+L|0,i[B++]=g+q|0,i[B++]=m+$|0,i[B++]=b+ae|0,i[B++]=v+G|0,i[B++]=k+W|0,i[B++]=S+ee|0,i[B++]=E+Q|0,i[B++]=w+V|0,i[B++]=C+M|0,i[B++]=T+P|0,i[B++]=N+I|0,i[B++]=A+Z|0,i[B++]=j+F|0,i[B++]=O+R|0}function A5(t,a,o,i){let l=St(t[0]),u=St(t[1]),f=St(t[2]),p=St(t[3]),g=St(a[0]),m=St(a[1]),b=St(a[2]),v=St(a[3]),k=St(a[4]),S=St(a[5]),E=St(a[6]),w=St(a[7]),C=St(o[0]),T=St(o[1]),N=St(o[2]),A=St(o[3]);for(let O=0;O<20;O+=2)l=l+g|0,C=ge(C^l,16),k=k+C|0,g=ge(g^k,12),l=l+g|0,C=ge(C^l,8),k=k+C|0,g=ge(g^k,7),u=u+m|0,T=ge(T^u,16),S=S+T|0,m=ge(m^S,12),u=u+m|0,T=ge(T^u,8),S=S+T|0,m=ge(m^S,7),f=f+b|0,N=ge(N^f,16),E=E+N|0,b=ge(b^E,12),f=f+b|0,N=ge(N^f,8),E=E+N|0,b=ge(b^E,7),p=p+v|0,A=ge(A^p,16),w=w+A|0,v=ge(v^w,12),p=p+v|0,A=ge(A^p,8),w=w+A|0,v=ge(v^w,7),l=l+m|0,A=ge(A^l,16),E=E+A|0,m=ge(m^E,12),l=l+m|0,A=ge(A^l,8),E=E+A|0,m=ge(m^E,7),u=u+b|0,C=ge(C^u,16),w=w+C|0,b=ge(b^w,12),u=u+b|0,C=ge(C^u,8),w=w+C|0,b=ge(b^w,7),f=f+v|0,T=ge(T^f,16),k=k+T|0,v=ge(v^k,12),f=f+v|0,T=ge(T^f,8),k=k+T|0,v=ge(v^k,7),p=p+g|0,N=ge(N^p,16),S=S+N|0,g=ge(g^S,12),p=p+g|0,N=ge(N^p,8),S=S+N|0,g=ge(g^S,7);let j=0;i[j++]=l,i[j++]=u,i[j++]=f,i[j++]=p,i[j++]=C,i[j++]=T,i[j++]=N,i[j++]=A,Fa(i)}const R5=T5(_5,{counterRight:!1,counterLength:8,extendNonceFn:A5,allowShortKeys:!1}),O5=new Uint8Array(16),wb=(t,a)=>{t.update(a);const o=a.length%16;o&&t.update(O5.subarray(o))},D5=new Uint8Array(32);function xb(t,a,o,i,l){l!==void 0&&Et(l,void 0,"AAD");const u=t(a,o,D5),f=x5(i.length,l?l.length:0,!0),p=j5.create(u);l&&wb(p,l),wb(p,i),p.update(f);const g=p.digest();return Ya(u,f),g}const M5=t=>(a,o,i)=>({encrypt(u,f){const p=u.length;f=um(p+16,f,!1),f.set(u);const g=f.subarray(0,-16);t(a,o,g,g,1);const m=xb(t,a,o,g,i);return f.set(m,p),Ya(m),f},decrypt(u,f){f=um(u.length-16,f,!1);const p=u.subarray(0,-16),g=u.subarray(-16),m=xb(t,a,o,p,i);if(!y5(g,m))throw Ya(m),new Error("invalid tag");return f.set(u.subarray(0,-16)),t(a,o,f,f,1),Ya(m),f}}),Kx=w5({blockSize:64,nonceLength:24,tagLength:16},M5(R5));function L5(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}function No(t,a=""){if(typeof t!="number"){const o=a&&`"${a}" `;throw new TypeError(`${o}expected number, got ${typeof t}`)}if(!Number.isSafeInteger(t)||t<0){const o=a&&`"${a}" `;throw new RangeError(`${o}expected integer >= 0, got ${t}`)}}function ua(t,a,o=""){const i=L5(t),l=t?.length,u=a!==void 0;if(!i||u&&l!==a){const f=o&&`"${o}" `,p=u?` of length ${a}`:"",g=i?`length=${l}`:`type=${typeof t}`,m=f+"expected Uint8Array"+p+", got "+g;throw i?new RangeError(m):new TypeError(m)}return t}function Zm(t){if(typeof t!="function"||typeof t.create!="function")throw new TypeError("Hash must wrapped by utils.createHasher");if(No(t.outputLen),No(t.blockLen),t.outputLen<1)throw new Error('"outputLen" must be >= 1');if(t.blockLen<1)throw new Error('"blockLen" must be >= 1')}function cc(t,a=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(a&&t.finished)throw new Error("Hash#digest() has already been called")}function Yx(t,a){ua(t,void 0,"digestInto() output");const o=a.outputLen;if(t.length<o)throw new RangeError('"digestInto() output" expected to be of length >='+o)}function ei(...t){for(let a=0;a<t.length;a++)t[a].fill(0)}function Mf(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Dn(t,a){return t<<32-a|t>>>a}const $x=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",z5=Array.from({length:256},(t,a)=>a.toString(16).padStart(2,"0"));function Qm(t){if(ua(t),$x)return t.toHex();let a="";for(let o=0;o<t.length;o++)a+=z5[t[o]];return a}const sa={_0:48,_9:57,A:65,F:70,a:97,f:102};function kb(t){if(t>=sa._0&&t<=sa._9)return t-sa._0;if(t>=sa.A&&t<=sa.F)return t-(sa.A-10);if(t>=sa.a&&t<=sa.f)return t-(sa.a-10)}function Jm(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);if($x)try{return Uint8Array.fromHex(t)}catch(l){throw l instanceof SyntaxError?new RangeError(l.message):l}const a=t.length,o=a/2;if(a%2)throw new RangeError("hex string expected, got unpadded hex of length "+a);const i=new Uint8Array(o);for(let l=0,u=0;l<o;l++,u+=2){const f=kb(t.charCodeAt(u)),p=kb(t.charCodeAt(u+1));if(f===void 0||p===void 0){const g=t[u]+t[u+1];throw new RangeError('hex string expected, got non-hex character "'+g+'" at index '+u)}i[l]=f*16+p}return i}function H5(t,a={}){const o=(l,u)=>t(u).update(l).digest(),i=t(void 0);return o.outputLen=i.outputLen,o.blockLen=i.blockLen,o.canXOF=i.canXOF,o.create=l=>t(l),Object.assign(o,a),Object.freeze(o)}function B5(t=32){No(t,"bytesLength");const a=typeof globalThis=="object"?globalThis.crypto:null;if(typeof a?.getRandomValues!="function")throw new Error("crypto.getRandomValues must be defined");if(t>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${t}`);return a.getRandomValues(new Uint8Array(t))}const U5=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});function W5(t,a,o){return t&a^~t&o}function I5(t,a,o){return t&a^t&o^a&o}class q5{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(a,o,i,l){this.blockLen=a,this.outputLen=o,this.padOffset=i,this.isLE=l,this.buffer=new Uint8Array(a),this.view=Mf(this.buffer)}update(a){cc(this),ua(a);const{view:o,buffer:i,blockLen:l}=this,u=a.length;for(let f=0;f<u;){const p=Math.min(l-this.pos,u-f);if(p===l){const g=Mf(a);for(;l<=u-f;f+=l)this.process(g,f);continue}i.set(a.subarray(f,f+p),this.pos),this.pos+=p,f+=p,this.pos===l&&(this.process(o,0),this.pos=0)}return this.length+=a.length,this.roundClean(),this}digestInto(a){cc(this),Yx(a,this),this.finished=!0;const{buffer:o,view:i,blockLen:l,isLE:u}=this;let{pos:f}=this;o[f++]=128,ei(this.buffer.subarray(f)),this.padOffset>l-f&&(this.process(i,0),f=0);for(let v=f;v<l;v++)o[v]=0;i.setBigUint64(l-8,BigInt(this.length*8),u),this.process(i,0);const p=Mf(a),g=this.outputLen;if(g%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const m=g/4,b=this.get();if(m>b.length)throw new Error("_sha2: outputLen bigger than state");for(let v=0;v<m;v++)p.setUint32(4*v,b[v],u)}digest(){const{buffer:a,outputLen:o}=this;this.digestInto(a);const i=a.slice(0,o);return this.destroy(),i}_cloneInto(a){a||=new this.constructor,a.set(...this.get());const{blockLen:o,buffer:i,length:l,finished:u,destroyed:f,pos:p}=this;return a.destroyed=f,a.finished=u,a.length=l,a.pos=p,l%o&&a.buffer.set(i),a}clone(){return this._cloneInto()}}const Ua=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),P5=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Wa=new Uint32Array(64);class F5 extends q5{constructor(a){super(64,a,8,!1)}get(){const{A:a,B:o,C:i,D:l,E:u,F:f,G:p,H:g}=this;return[a,o,i,l,u,f,p,g]}set(a,o,i,l,u,f,p,g){this.A=a|0,this.B=o|0,this.C=i|0,this.D=l|0,this.E=u|0,this.F=f|0,this.G=p|0,this.H=g|0}process(a,o){for(let v=0;v<16;v++,o+=4)Wa[v]=a.getUint32(o,!1);for(let v=16;v<64;v++){const k=Wa[v-15],S=Wa[v-2],E=Dn(k,7)^Dn(k,18)^k>>>3,w=Dn(S,17)^Dn(S,19)^S>>>10;Wa[v]=w+Wa[v-7]+E+Wa[v-16]|0}let{A:i,B:l,C:u,D:f,E:p,F:g,G:m,H:b}=this;for(let v=0;v<64;v++){const k=Dn(p,6)^Dn(p,11)^Dn(p,25),S=b+k+W5(p,g,m)+P5[v]+Wa[v]|0,w=(Dn(i,2)^Dn(i,13)^Dn(i,22))+I5(i,l,u)|0;b=m,m=g,g=p,p=f+S|0,f=u,u=l,l=i,i=S+w|0}i=i+this.A|0,l=l+this.B|0,u=u+this.C|0,f=f+this.D|0,p=p+this.E|0,g=g+this.F|0,m=m+this.G|0,b=b+this.H|0,this.set(i,l,u,f,p,g,m,b)}roundClean(){ei(Wa)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),ei(this.buffer)}}class K5 extends F5{A=Ua[0]|0;B=Ua[1]|0;C=Ua[2]|0;D=Ua[3]|0;E=Ua[4]|0;F=Ua[5]|0;G=Ua[6]|0;H=Ua[7]|0;constructor(){super(32)}}const ko=H5(()=>new K5,U5(1));const $a=(t,a,o)=>ua(t,a,o),Vx=No,Gx=Qm,Y5=t=>Jm(t),$5=t=>B5(t),uc=BigInt(0),fm=BigInt(1);function Xx(t,a=""){if(typeof t!="boolean"){const o=a&&`"${a}" `;throw new TypeError(o+"expected boolean, got type="+typeof t)}return t}function V5(t){if(typeof t=="bigint"){if(!Vl(t))throw new RangeError("positive bigint expected, got "+t)}else Vx(t);return t}function Sb(t,a=""){if(typeof t!="number"){const o=a&&`"${a}" `;throw new TypeError(o+"expected number, got type="+typeof t)}if(!Number.isSafeInteger(t)){const o=a&&`"${a}" `;throw new RangeError(o+"expected safe integer, got "+t)}}function Zx(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);return t===""?uc:BigInt("0x"+t)}function G5(t){return Zx(Qm(t))}function ti(t){return Zx(Qm(ni(ua(t)).reverse()))}function Qx(t,a){if(No(a),a===0)throw new RangeError("zero length");t=V5(t);const o=t.toString(16);if(o.length>a*2)throw new RangeError("number too large");return Jm(o.padStart(a*2,"0"))}function Jx(t,a){return Qx(t,a).reverse()}function X5(t,a){if(t=$a(t),a=$a(a),t.length!==a.length)return!1;let o=0;for(let i=0;i<t.length;i++)o|=t[i]^a[i];return o===0}function ni(t){return Uint8Array.from($a(t))}const Vl=t=>typeof t=="bigint"&&uc<=t;function Z5(t,a,o){return Vl(t)&&Vl(a)&&Vl(o)&&a<=t&&t<o}function dc(t,a,o,i){if(!Z5(a,o,i))throw new RangeError("expected valid "+t+": "+o+" <= n < "+i+", got "+a)}function Q5(t){if(t<uc)throw new Error("expected non-negative bigint, got "+t);let a;for(a=0;t>uc;t>>=fm,a+=1);return a}const J5=t=>(fm<<BigInt(t))-fm;function ep(t,a={},o={}){if(Object.prototype.toString.call(t)!=="[object Object]")throw new TypeError("expected valid options object");function i(u,f,p){if(!p&&f!=="function"&&!Object.hasOwn(t,u))throw new TypeError(`param "${u}" is invalid: expected own property`);const g=t[u];if(p&&g===void 0)return;const m=typeof g;if(m!==f||g===null)throw new TypeError(`param "${u}" is invalid: expected ${f}, got ${m}`)}const l=(u,f)=>Object.entries(u).forEach(([p,g])=>i(p,g,f));l(a,!1),l(o,!0)}const Eb=()=>{throw new Error("not implemented")};const Ct=BigInt(0),wt=BigInt(1),xr=BigInt(2),e1=BigInt(3),t1=BigInt(4),n1=BigInt(5),e6=BigInt(7),a1=BigInt(8),t6=BigInt(9),r1=BigInt(16);function st(t,a){if(a<=Ct)throw new Error("mod: expected positive modulus, got "+a);const o=t%a;return o>=Ct?o:a+o}function xn(t,a,o){if(a<Ct)throw new Error("pow2: expected non-negative exponent, got "+a);let i=t;for(;a-- >Ct;)i*=i,i%=o;return i}function Cb(t,a){if(t===Ct)throw new Error("invert: expected non-zero number");if(a<=Ct)throw new Error("invert: expected positive modulus, got "+a);let o=st(t,a),i=a,l=Ct,u=wt;for(;o!==Ct;){const p=i/o,g=i-o*p,m=l-u*p;i=o,o=g,l=u,u=m}if(i!==wt)throw new Error("invert: does not exist");return st(l,a)}function tp(t,a,o){const i=t;if(!i.eql(i.sqr(a),o))throw new Error("Cannot find square root")}function o1(t,a){const o=t,i=(o.ORDER+wt)/t1,l=o.pow(a,i);return tp(o,l,a),l}function n6(t,a){const o=t,i=(o.ORDER-n1)/a1,l=o.mul(a,xr),u=o.pow(l,i),f=o.mul(a,u),p=o.mul(o.mul(f,xr),u),g=o.mul(f,o.sub(p,o.ONE));return tp(o,g,a),g}function a6(t){const a=np(t),o=s1(t),i=o(a,a.neg(a.ONE)),l=o(a,i),u=o(a,a.neg(i)),f=(t+e6)/r1;return((p,g)=>{const m=p;let b=m.pow(g,f),v=m.mul(b,i);const k=m.mul(b,l),S=m.mul(b,u),E=m.eql(m.sqr(v),g),w=m.eql(m.sqr(k),g);b=m.cmov(b,v,E),v=m.cmov(S,k,w);const C=m.eql(m.sqr(v),g),T=m.cmov(b,v,C);return tp(m,T,g),T})}function s1(t){if(t<e1)throw new Error("sqrt is not defined for small field");let a=t-wt,o=0;for(;a%xr===Ct;)a/=xr,o++;let i=xr;const l=np(t);for(;Tb(l,i)===1;)if(i++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(o===1)return o1;let u=l.pow(i,a);const f=(a+wt)/xr;return function(g,m){const b=g;if(b.is0(m))return m;if(Tb(b,m)!==1)throw new Error("Cannot find square root");let v=o,k=b.mul(b.ONE,u),S=b.pow(m,a),E=b.pow(m,f);for(;!b.eql(S,b.ONE);){if(b.is0(S))return b.ZERO;let w=1,C=b.sqr(S);for(;!b.eql(C,b.ONE);)if(w++,C=b.sqr(C),w===v)throw new Error("Cannot find square root");const T=wt<<BigInt(v-w-1),N=b.pow(k,T);v=w,k=b.sqr(N),S=b.mul(S,k),E=b.mul(E,N)}return E}}function r6(t){return t%t1===e1?o1:t%a1===n1?n6:t%r1===t6?a6(t):s1(t)}const br=(t,a)=>(st(t,a)&wt)===wt,o6=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function s6(t){const a={ORDER:"bigint",BYTES:"number",BITS:"number"},o=o6.reduce((i,l)=>(i[l]="function",i),a);if(ep(t,o),Sb(t.BYTES,"BYTES"),Sb(t.BITS,"BITS"),t.BYTES<1||t.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(t.ORDER<=wt)throw new Error("invalid field: expected ORDER > 1, got "+t.ORDER);return t}function i6(t,a,o){const i=t;if(o<Ct)throw new Error("invalid exponent, negatives unsupported");if(o===Ct)return i.ONE;if(o===wt)return a;let l=i.ONE,u=a;for(;o>Ct;)o&wt&&(l=i.mul(l,u)),u=i.sqr(u),o>>=wt;return l}function i1(t,a,o=!1){const i=t,l=new Array(a.length).fill(o?i.ZERO:void 0),u=a.reduce((p,g,m)=>i.is0(g)?p:(l[m]=p,i.mul(p,g)),i.ONE),f=i.inv(u);return a.reduceRight((p,g,m)=>i.is0(g)?p:(l[m]=i.mul(p,l[m]),i.mul(p,g)),f),l}function Tb(t,a){const o=t,i=(o.ORDER-wt)/xr,l=o.pow(a,i),u=o.eql(l,o.ONE),f=o.eql(l,o.ZERO),p=o.eql(l,o.neg(o.ONE));if(!u&&!f&&!p)throw new Error("invalid Legendre symbol result");return u?1:f?0:-1}function l6(t,a){if(a!==void 0&&Vx(a),t<=Ct)throw new Error("invalid n length: expected positive n, got "+t);if(a!==void 0&&a<1)throw new Error("invalid n length: expected positive bit length, got "+a);const o=Q5(t);if(a!==void 0&&a<o)throw new Error(`invalid n length: expected bit length (${o}) >= n.length (${a})`);const i=a!==void 0?a:o,l=Math.ceil(i/8);return{nBitLength:i,nByteLength:l}}const Nb=new WeakMap;class l1{ORDER;BITS;BYTES;isLE;ZERO=Ct;ONE=wt;_lengths;_mod;constructor(a,o={}){if(a<=wt)throw new Error("invalid field: expected ORDER > 1, got "+a);let i;this.isLE=!1,o!=null&&typeof o=="object"&&(typeof o.BITS=="number"&&(i=o.BITS),typeof o.sqrt=="function"&&Object.defineProperty(this,"sqrt",{value:o.sqrt,enumerable:!0}),typeof o.isLE=="boolean"&&(this.isLE=o.isLE),o.allowedLengths&&(this._lengths=Object.freeze(o.allowedLengths.slice())),typeof o.modFromBytes=="boolean"&&(this._mod=o.modFromBytes));const{nBitLength:l,nByteLength:u}=l6(a,i);if(u>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=a,this.BITS=l,this.BYTES=u,Object.freeze(this)}create(a){return st(a,this.ORDER)}isValid(a){if(typeof a!="bigint")throw new TypeError("invalid field element: expected bigint, got "+typeof a);return Ct<=a&&a<this.ORDER}is0(a){return a===Ct}isValidNot0(a){return!this.is0(a)&&this.isValid(a)}isOdd(a){return(a&wt)===wt}neg(a){return st(-a,this.ORDER)}eql(a,o){return a===o}sqr(a){return st(a*a,this.ORDER)}add(a,o){return st(a+o,this.ORDER)}sub(a,o){return st(a-o,this.ORDER)}mul(a,o){return st(a*o,this.ORDER)}pow(a,o){return i6(this,a,o)}div(a,o){return st(a*Cb(o,this.ORDER),this.ORDER)}sqrN(a){return a*a}addN(a,o){return a+o}subN(a,o){return a-o}mulN(a,o){return a*o}inv(a){return Cb(a,this.ORDER)}sqrt(a){let o=Nb.get(this);return o||Nb.set(this,o=r6(this.ORDER)),o(this,a)}toBytes(a){return this.isLE?Jx(a,this.BYTES):Qx(a,this.BYTES)}fromBytes(a,o=!1){$a(a);const{_lengths:i,BYTES:l,isLE:u,ORDER:f,_mod:p}=this;if(i){if(a.length<1||!i.includes(a.length)||a.length>l)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+a.length);const m=new Uint8Array(l);m.set(a,u?0:m.length-a.length),a=m}if(a.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+a.length);let g=u?ti(a):G5(a);if(p&&(g=st(g,f)),!o&&!this.isValid(g))throw new Error("invalid field element: outside of range 0..ORDER");return g}invertBatch(a){return i1(this,a)}cmov(a,o,i){return Xx(i,"condition"),i?o:a}}Object.freeze(l1.prototype);function np(t,a={}){return new l1(t,a)}const fc=BigInt(0),mm=BigInt(1);function jb(t,a){const o=a.negate();return t?o:a}function Lf(t,a){const o=i1(t.Fp,a.map(i=>i.Z));return a.map((i,l)=>t.fromAffine(i.toAffine(o[l])))}function c1(t,a){if(!Number.isSafeInteger(t)||t<=0||t>a)throw new Error("invalid window size, expected [1.."+a+"], got W="+t)}function zf(t,a){c1(t,a);const o=Math.ceil(a/t)+1,i=2**(t-1),l=2**t,u=J5(t),f=BigInt(t);return{windows:o,windowSize:i,mask:u,maxNumber:l,shiftBy:f}}function _b(t,a,o){const{windowSize:i,mask:l,maxNumber:u,shiftBy:f}=o;let p=Number(t&l),g=t>>f;p>i&&(p-=u,g+=mm);const m=a*i,b=m+Math.abs(p)-1,v=p===0,k=p<0,S=a%2!==0;return{nextN:g,offset:b,isZero:v,isNeg:k,isNegF:S,offsetF:m}}const Hf=new WeakMap,u1=new WeakMap;function Bf(t){return u1.get(t)||1}function Ab(t){if(t!==fc)throw new Error("invalid wNAF")}class c6{BASE;ZERO;Fn;bits;constructor(a,o){this.BASE=a.BASE,this.ZERO=a.ZERO,this.Fn=a.Fn,this.bits=o}_unsafeLadder(a,o,i=this.ZERO){let l=a;for(;o>fc;)o&mm&&(i=i.add(l)),l=l.double(),o>>=mm;return i}precomputeWindow(a,o){const{windows:i,windowSize:l}=zf(o,this.bits),u=[];let f=a,p=f;for(let g=0;g<i;g++){p=f,u.push(p);for(let m=1;m<l;m++)p=p.add(f),u.push(p);f=p.double()}return u}wNAF(a,o,i){if(!this.Fn.isValid(i))throw new Error("invalid scalar");let l=this.ZERO,u=this.BASE;const f=zf(a,this.bits);for(let p=0;p<f.windows;p++){const{nextN:g,offset:m,isZero:b,isNeg:v,isNegF:k,offsetF:S}=_b(i,p,f);i=g,b?u=u.add(jb(k,o[S])):l=l.add(jb(v,o[m]))}return Ab(i),{p:l,f:u}}wNAFUnsafe(a,o,i,l=this.ZERO){const u=zf(a,this.bits);for(let f=0;f<u.windows&&i!==fc;f++){const{nextN:p,offset:g,isZero:m,isNeg:b}=_b(i,f,u);if(i=p,!m){const v=o[g];l=l.add(b?v.negate():v)}}return Ab(i),l}getPrecomputes(a,o,i){let l=Hf.get(o);return l||(l=this.precomputeWindow(o,a),a!==1&&(typeof i=="function"&&(l=i(l)),Hf.set(o,l))),l}cached(a,o,i){const l=Bf(a);return this.wNAF(l,this.getPrecomputes(l,a,i),o)}unsafe(a,o,i,l){const u=Bf(a);return u===1?this._unsafeLadder(a,o,l):this.wNAFUnsafe(u,this.getPrecomputes(u,a,i),o,l)}createCache(a,o){c1(o,this.bits),u1.set(a,o),Hf.delete(a)}hasCache(a){return Bf(a)!==1}}function Rb(t,a,o){if(a){if(a.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return s6(a),a}else return np(t,{isLE:o})}function u6(t,a,o={},i){if(i===void 0&&(i=t==="edwards"),!a||typeof a!="object")throw new Error(`expected valid ${t} CURVE object`);for(const g of["p","n","h"]){const m=a[g];if(!(typeof m=="bigint"&&m>fc))throw new Error(`CURVE.${g} must be positive bigint`)}const l=Rb(a.p,o.Fp,i),u=Rb(a.n,o.Fn,i),p=["Gx","Gy","a","d"];for(const g of p)if(!l.isValid(a[g]))throw new Error(`CURVE.${g} must be valid field element of CURVE.Fp`);return a=Object.freeze(Object.assign({},a)),{CURVE:a,Fp:l,Fn:u}}function d6(t,a){return function(i){const l=t(i);return{secretKey:l,publicKey:a(l)}}}const Ia=BigInt(0),Ht=BigInt(1),Uf=BigInt(2),f6=BigInt(8);function m6(t,a,o,i){const l=t.sqr(o),u=t.sqr(i),f=t.add(t.mul(a.a,l),u),p=t.add(t.ONE,t.mul(a.d,t.mul(l,u)));return t.eql(f,p)}function p6(t,a={}){const o=a,i=u6("edwards",t,o,o.FpFnLE),{Fp:l,Fn:u}=i;let f=i.CURVE;const{h:p}=f;ep(o,{},{uvRatio:"function"});const g=Uf<<BigInt(u.BYTES*8)-Ht,m=w=>l.create(w),b=o.uvRatio===void 0?(w,C)=>{try{return{isValid:!0,value:l.sqrt(l.div(w,C))}}catch{return{isValid:!1,value:Ia}}}:o.uvRatio;if(!m6(l,f,f.Gx,f.Gy))throw new Error("bad curve params: generator point");function v(w,C,T=!1){const N=T?Ht:Ia;return dc("coordinate "+w,C,N,g),C}function k(w){if(!(w instanceof S))throw new Error("EdwardsPoint expected")}class S{static BASE=new S(f.Gx,f.Gy,Ht,m(f.Gx*f.Gy));static ZERO=new S(Ia,Ht,Ht,Ia);static Fp=l;static Fn=u;X;Y;Z;T;constructor(C,T,N,A){this.X=v("x",C),this.Y=v("y",T),this.Z=v("z",N,!0),this.T=v("t",A),Object.freeze(this)}static CURVE(){return f}static fromAffine(C){if(C instanceof S)throw new Error("extended point not allowed");const{x:T,y:N}=C||{};return v("x",T),v("y",N),new S(T,N,Ht,m(T*N))}static fromBytes(C,T=!1){const N=l.BYTES,{a:A,d:j}=f;C=ni($a(C,N,"point")),Xx(T,"zip215");const O=ni(C),D=C[N-1];O[N-1]=D&-129;const L=ti(O),q=T?g:l.ORDER;dc("point.y",L,Ia,q);const $=m(L*L),ae=m($-Ht),G=m(j*$-A);let{isValid:W,value:ee}=b(ae,G);if(!W)throw new Error("bad point: invalid y coordinate");const Q=(ee&Ht)===Ht,V=(D&128)!==0;if(!T&&ee===Ia&&V)throw new Error("bad point: x=0 and x_0=1");return V!==Q&&(ee=m(-ee)),S.fromAffine({x:ee,y:L})}static fromHex(C,T=!1){return S.fromBytes(Y5(C),T)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(C=8,T=!0){return E.createCache(this,C),T||this.multiply(Uf),this}assertValidity(){const C=this,{a:T,d:N}=f;if(C.is0())throw new Error("bad point: ZERO");const{X:A,Y:j,Z:O,T:D}=C,L=m(A*A),q=m(j*j),$=m(O*O),ae=m($*$),G=m(L*T),W=m($*m(G+q)),ee=m(ae+m(N*m(L*q)));if(W!==ee)throw new Error("bad point: equation left != right (1)");const Q=m(A*j),V=m(O*D);if(Q!==V)throw new Error("bad point: equation left != right (2)")}equals(C){k(C);const{X:T,Y:N,Z:A}=this,{X:j,Y:O,Z:D}=C,L=m(T*D),q=m(j*A),$=m(N*D),ae=m(O*A);return L===q&&$===ae}is0(){return this.equals(S.ZERO)}negate(){return new S(m(-this.X),this.Y,this.Z,m(-this.T))}double(){const{a:C}=f,{X:T,Y:N,Z:A}=this,j=m(T*T),O=m(N*N),D=m(Uf*m(A*A)),L=m(C*j),q=T+N,$=m(m(q*q)-j-O),ae=L+O,G=ae-D,W=L-O,ee=m($*G),Q=m(ae*W),V=m($*W),M=m(G*ae);return new S(ee,Q,M,V)}add(C){k(C);const{a:T,d:N}=f,{X:A,Y:j,Z:O,T:D}=this,{X:L,Y:q,Z:$,T:ae}=C,G=m(A*L),W=m(j*q),ee=m(D*N*ae),Q=m(O*$),V=m((A+j)*(L+q)-G-W),M=Q-ee,P=Q+ee,I=m(W-T*G),Z=m(V*M),F=m(P*I),R=m(V*I),B=m(M*P);return new S(Z,F,B,R)}subtract(C){return k(C),this.add(C.negate())}multiply(C){if(!u.isValidNot0(C))throw new RangeError("invalid scalar: expected 1 <= sc < curve.n");const{p:T,f:N}=E.cached(this,C,A=>Lf(S,A));return Lf(S,[T,N])[0]}multiplyUnsafe(C){if(!u.isValid(C))throw new RangeError("invalid scalar: expected 0 <= sc < curve.n");return C===Ia?S.ZERO:this.is0()||C===Ht?this:E.unsafe(this,C,T=>Lf(S,T))}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return E.unsafe(this,f.n).is0()}toAffine(C){const T=this;let N=C;const{X:A,Y:j,Z:O}=T,D=T.is0();N==null&&(N=D?f6:l.inv(O));const L=m(A*N),q=m(j*N),$=l.mul(O,N);if(D)return{x:Ia,y:Ht};if($!==Ht)throw new Error("invZ was invalid");return{x:L,y:q}}clearCofactor(){return p===Ht?this:this.multiplyUnsafe(p)}toBytes(){const{x:C,y:T}=this.toAffine(),N=l.toBytes(T);return N[N.length-1]|=C&Ht?128:0,N}toHex(){return Gx(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const E=new c6(S,u.BITS);return u.BITS>=8&&S.BASE.precompute(8),Object.freeze(S.prototype),Object.freeze(S),S}class h6{static BASE;static ZERO;static Fp;static Fn;ep;constructor(a){this.ep=a}static fromBytes(a){Eb()}static fromHex(a){Eb()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(a){return this.ep.toAffine(a)}toHex(){return Gx(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(a){return this.assertSame(a),this.init(this.ep.add(a.ep))}subtract(a){return this.assertSame(a),this.init(this.ep.subtract(a.ep))}multiply(a){return this.init(this.ep.multiply(a))}multiplyUnsafe(a){return this.init(this.ep.multiplyUnsafe(a))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(a,o){return this.ep.precompute(a,o),this}}const Hs=BigInt(0),vo=BigInt(1),Bl=BigInt(2);function g6(t){return ep(t,{P:"bigint",type:"string",adjustScalarBytes:"function",powPminus2:"function"},{randomBytes:"function"}),Object.freeze({...t})}function v6(t){const a=g6(t),{P:o,type:i,adjustScalarBytes:l,powPminus2:u,randomBytes:f}=a,p=i==="x25519";if(!p&&i!=="x448")throw new Error("invalid type");const g=f===void 0?$5:f,m=p?255:448,b=p?32:56,v=BigInt(p?9:5),k=BigInt(p?121665:39081),S=p?Bl**BigInt(254):Bl**BigInt(447),E=p?BigInt(8)*Bl**BigInt(251)-vo:BigInt(4)*Bl**BigInt(445)-vo,w=S+E+vo,C=Q=>st(Q,o),T=N(v);function N(Q){return Jx(C(Q),b)}function A(Q){const V=ni($a(Q,b,"uCoordinate"));return p&&(V[31]&=127),C(ti(V))}function j(Q){return ti(l(ni($a(Q,b,"scalar"))))}function O(Q,V){const M=ae(A(V),j(Q));if(M===Hs)throw new Error("invalid private or public key received");return N(M)}function D(Q){return O(Q,T)}const L=D,q=O;function $(Q,V,M){const P=C(Q*(V-M));return V=C(V-P),M=C(M+P),{x_2:V,x_3:M}}function ae(Q,V){dc("u",Q,Hs,o),dc("scalar",V,S,w);const M=V,P=Q;let I=vo,Z=Hs,F=Q,R=vo,B=Hs;for(let te=BigInt(m-1);te>=Hs;te--){const fe=M>>te&vo;B^=fe,{x_2:I,x_3:F}=$(B,I,F),{x_2:Z,x_3:R}=$(B,Z,R),B=fe;const me=I+Z,ue=C(me*me),ie=I-Z,le=C(ie*ie),ce=ue-le,de=F+R,Te=F-R,xe=C(Te*me),qe=C(de*ie),Qe=xe+qe,_t=xe-qe;F=C(Qe*Qe),R=C(P*C(_t*_t)),I=C(ue*le),Z=C(ce*(ue+C(k*ce)))}({x_2:I,x_3:F}=$(B,I,F)),{x_2:Z,x_3:R}=$(B,Z,R);const se=u(Z);return C(I*se)}const G={secretKey:b,publicKey:b,seed:b},W=Q=>(Q=Q===void 0?g(b):Q,$a(Q,G.seed,"seed"),Q),ee={randomSecretKey:W};return Object.freeze(G),Object.freeze(ee),Object.freeze({keygen:d6(W,L),getSharedSecret:q,getPublicKey:L,scalarMult:O,scalarMultBase:D,utils:ee,GuBytes:T.slice(),lengths:G})}const y6=BigInt(0),Ys=BigInt(1),Ob=BigInt(2),b6=BigInt(3),w6=BigInt(5),x6=BigInt(8),jo=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),d1={p:jo,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:x6,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function f1(t){const a=BigInt(10),o=BigInt(20),i=BigInt(40),l=BigInt(80),u=jo,p=t*t%u*t%u,g=xn(p,Ob,u)*p%u,m=xn(g,Ys,u)*t%u,b=xn(m,w6,u)*m%u,v=xn(b,a,u)*b%u,k=xn(v,o,u)*v%u,S=xn(k,i,u)*k%u,E=xn(S,l,u)*S%u,w=xn(E,l,u)*S%u,C=xn(w,a,u)*b%u;return{pow_p_5_8:xn(C,Ob,u)*t%u,b2:p}}function k6(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}const pm=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function m1(t,a){const o=jo,i=st(a*a*a,o),l=st(i*i*a,o),u=f1(t*l).pow_p_5_8;let f=st(t*i*u,o);const p=st(a*f*f,o),g=f,m=st(f*pm,o),b=p===t,v=p===st(-t,o),k=p===st(-t*pm,o);return b&&(f=g),(v||k)&&(f=m),br(f,o)&&(f=st(-f,o)),{isValid:b||v,value:f}}const yo=p6(d1,{uvRatio:m1}),wr=yo.Fp,S6=yo.Fn,hm=(()=>{const t=jo;return v6({P:t,type:"x25519",powPminus2:a=>{const{pow_p_5_8:o,b2:i}=f1(a);return st(xn(o,b6,t)*i,t)},adjustScalarBytes:k6})})(),Db=pm,E6=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Mb=t=>m1(Ys,t),C6=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),T6=t=>wr.create(ti(t)&C6);class Zt extends h6{static BASE=new Zt(yo.BASE);static ZERO=new Zt(yo.ZERO);static Fp=wr;static Fn=S6;constructor(a){super(a)}static fromAffine(a){return new Zt(yo.fromAffine(a))}assertSame(a){if(!(a instanceof Zt))throw new Error("RistrettoPoint expected")}init(a){return new Zt(a)}static fromBytes(a){ua(a,32);const{a:o,d:i}=d1,l=jo,u=j=>wr.create(j),f=T6(a);if(!X5(wr.toBytes(f),a)||br(f,l))throw new Error("invalid ristretto255 encoding 1");const p=u(f*f),g=u(Ys+o*p),m=u(Ys-o*p),b=u(g*g),v=u(m*m),k=u(o*i*b-v),{isValid:S,value:E}=Mb(u(k*v)),w=u(E*m),C=u(E*w*k);let T=u((f+f)*w);br(T,l)&&(T=u(-T));const N=u(g*C),A=u(T*N);if(!S||br(A,l)||N===y6)throw new Error("invalid ristretto255 encoding 2");return new Zt(new yo(T,N,Ys,A))}static fromHex(a){return Zt.fromBytes(Jm(a))}toBytes(){let{X:a,Y:o,Z:i,T:l}=this.ep;const u=jo,f=C=>wr.create(C),p=f(f(i+o)*f(i-o)),g=f(a*o),m=f(g*g),{value:b}=Mb(f(p*m)),v=f(b*p),k=f(b*g),S=f(v*k*l);let E;if(br(l*S,u)){let C=f(o*Db),T=f(a*Db);a=C,o=T,E=f(v*E6)}else E=k;br(a*S,u)&&(o=f(-o));let w=f((i-o)*E);return br(w,u)&&(w=f(-w)),wr.toBytes(w)}equals(a){this.assertSame(a);const{X:o,Y:i}=this.ep,{X:l,Y:u}=a.ep,f=m=>wr.create(m),p=f(o*u)===f(i*l),g=f(i*u)===f(o*l);return p||g}is0(){return this.equals(Zt.ZERO)}}Object.freeze(Zt.BASE);Object.freeze(Zt.ZERO);Object.freeze(Zt.prototype);Object.freeze(Zt);class Lb{oHash;iHash;blockLen;outputLen;canXOF=!1;finished=!1;destroyed=!1;constructor(a,o){if(Zm(a),ua(o,void 0,"key"),this.iHash=a.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,l=new Uint8Array(i);l.set(o.length>i?a.create().update(o).digest():o);for(let u=0;u<l.length;u++)l[u]^=54;this.iHash.update(l),this.oHash=a.create();for(let u=0;u<l.length;u++)l[u]^=106;this.oHash.update(l),ei(l)}update(a){return cc(this),this.iHash.update(a),this}digestInto(a){cc(this),Yx(a,this),this.finished=!0;const o=a.subarray(0,this.outputLen);this.iHash.digestInto(o),this.oHash.update(o),this.oHash.digestInto(o),this.destroy()}digest(){const a=new Uint8Array(this.oHash.outputLen);return this.digestInto(a),a}_cloneInto(a){a||=Object.create(Object.getPrototypeOf(this),{});const{oHash:o,iHash:i,finished:l,destroyed:u,blockLen:f,outputLen:p}=this;return a=a,a.finished=l,a.destroyed=u,a.blockLen=f,a.outputLen=p,a.oHash=o._cloneInto(a.oHash),a.iHash=i._cloneInto(a.iHash),a}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const p1=(()=>{const t=((a,o,i)=>new Lb(a,o).update(i).digest());return t.create=(a,o)=>new Lb(a,o),t})();function N6(t,a,o){return Zm(t),o===void 0&&(o=new Uint8Array(t.outputLen)),p1(t,o,a)}const Wf=Uint8Array.of(0),zb=Uint8Array.of();function j6(t,a,o,i=32){Zm(t),No(i,"length"),ua(a,void 0,"prk");const l=t.outputLen;if(a.length<l)throw new Error('"prk" must be at least HashLen octets');if(i>255*l)throw new Error("Length must be <= 255*HashLen");const u=Math.ceil(i/l);o===void 0?o=zb:ua(o,void 0,"info");const f=new Uint8Array(u*l),p=p1.create(t,a),g=p._cloneInto(),m=new Uint8Array(p.outputLen);for(let b=0;b<u;b++)Wf[0]=b+1,g.update(b===0?zb:m).update(o).update(Wf).digestInto(m),f.set(m,l*b),p._cloneInto(g);return p.destroy(),g.destroy(),ei(m,Wf),f.slice(0,i)}const ai=(t,a,o,i,l)=>j6(t,N6(t,a,o),i,l),Sn=2,Hb=32,_6=32,Ka=32,A6=24,gm=32,h1=32,R6=6,vm=32,g1="hive/remote/v1/pair",O6="hive/remote/v1/key/daemon->device",D6="hive/remote/v1/key/device->daemon",M6="hive/remote/v1/sas",L6="hive/remote/v1/transcript",z6="hive/remote/v2/conn/daemon->device",H6="hive/remote/v2/conn/device->daemon",B6="hive/remote/v2/conn-salt",U6=1,W6=2,I6=4,q6=8,v1=12,P6=new TextEncoder;function Jt(t){return P6.encode(t)}function zn(...t){let a=0;for(const l of t)a+=l.length;const o=new Uint8Array(a);let i=0;for(const l of t)o.set(l,i),i+=l.length;return o}function Dc(t){if(!Number.isInteger(t)||t<0||t>4294967295)throw new RangeError(`u32be out of range: ${t}`);const a=new Uint8Array(4);return new DataView(a.buffer).setUint32(0,t),a}function ap(t,a=0){if(t.length<a+4)throw new RangeError("u32beRead: buffer too short");return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint32(a)}function F6(t){if(!Number.isSafeInteger(t)||t<0)throw new RangeError(`u64be out of range: ${t}`);const a=new Uint8Array(8),o=Math.floor(t/4294967296),i=t>>>0,l=new DataView(a.buffer);return l.setUint32(0,o),l.setUint32(4,i),a}function mc(t){if(t.length>65535)throw new RangeError("lp: value too long for u16 length prefix");const a=new Uint8Array(2+t.length);return new DataView(a.buffer).setUint16(0,t.length),a.set(t,2),a}function gn(t,a,o){if(t.length!==a)throw new RangeError(`${o} must be ${a} bytes, got ${t.length}`)}const kn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",K6=(()=>{const t=new Int16Array(128).fill(-1);for(let a=0;a<kn.length;a++)t[kn.charCodeAt(a)]=a;return t})();function kr(t){let a="",o=0;for(;o+3<=t.length;o+=3){const l=t[o],u=t[o+1],f=t[o+2];a+=kn[l>>2],a+=kn[(l&3)<<4|u>>4],a+=kn[(u&15)<<2|f>>6],a+=kn[f&63]}const i=t.length-o;if(i===1){const l=t[o];a+=kn[l>>2],a+=kn[(l&3)<<4]}else if(i===2){const l=t[o],u=t[o+1];a+=kn[l>>2],a+=kn[(l&3)<<4|u>>4],a+=kn[(u&15)<<2]}return a}function ri(t){if(t.length%4===1)throw new RangeError("invalid base64url");const a=t.length>>2,o=t.length&3,i=a*3+(o===0?0:o-1),l=new Uint8Array(i),u=g=>{if(g>=128)throw new RangeError("invalid base64url");const m=K6[g];if(m<0)throw new RangeError("invalid base64url");return m};let f=0,p=0;for(;p+4<=t.length;p+=4){const g=u(t.charCodeAt(p)),m=u(t.charCodeAt(p+1)),b=u(t.charCodeAt(p+2)),v=u(t.charCodeAt(p+3));l[f++]=g<<2|m>>4,l[f++]=(m&15)<<4|b>>2,l[f++]=(b&3)<<6|v}if(o===2){const g=u(t.charCodeAt(p)),m=u(t.charCodeAt(p+1));l[f++]=g<<2|m>>4}else if(o===3){const g=u(t.charCodeAt(p)),m=u(t.charCodeAt(p+1)),b=u(t.charCodeAt(p+2));l[f++]=g<<2|m>>4,l[f++]=(m&15)<<4|b>>2}return l}function Y6(t){return JSON.stringify(t)}function $6(t){let a;try{a=JSON.parse(t)}catch{throw new RangeError("invalid pairing payload: not JSON")}if(typeof a!="object"||a===null)throw new RangeError("invalid pairing payload: not an object");const o=a;if(o.v!==Sn)throw new RangeError(`unsupported pairing version: ${String(o.v)}`);if(typeof o.gatewayUrl!="string"||o.gatewayUrl.length===0)throw new RangeError("invalid pairing payload: gatewayUrl");if(typeof o.daemonId!="string"||o.daemonId.length===0)throw new RangeError("invalid pairing payload: daemonId");if(typeof o.pairingSecret!="string")throw new RangeError("invalid pairing payload: pairingSecret");if(ri(o.pairingSecret).length!==gm)throw new RangeError(`pairingSecret must be ${gm} bytes`);return{v:o.v,gatewayUrl:o.gatewayUrl,daemonId:o.daemonId,pairingSecret:o.pairingSecret}}function V6(){const t=hm.utils.randomSecretKey(),a=hm.getPublicKey(t);return{secretKey:t,publicKey:a}}function G6(t){return{secretKey:kr(t.secretKey),publicKey:kr(t.publicKey)}}function X6(){return Px(h1)}function Z6(t){gn(t.pairingSecret,gm,"pairingSecret"),gn(t.sessionSalt,h1,"sessionSalt"),gn(t.daemonPublicKey,Hb,"daemonPublicKey"),gn(t.devicePublicKey,Hb,"devicePublicKey");const a=hm.getSharedSecret(t.localSecretKey,t.peerPublicKey);gn(a,_6,"sharedSecret");const o=zn(t.pairingSecret,a),i=zn(Jt(L6),Uint8Array.of(0),Dc(t.ids.protocolVersion),mc(Jt(t.ids.daemonId)),mc(Jt(t.ids.deviceId)),t.daemonPublicKey,t.devicePublicKey,t.sessionSalt),l=ko(i),u=zn(Jt(g1),t.sessionSalt),f=ai(ko,o,u,zn(Jt(O6),Uint8Array.of(0),l),Ka),p=ai(ko,o,u,zn(Jt(D6),Uint8Array.of(0),l),Ka),g=tD(l,t.ids);return{d2p:f,p2d:p,sas:g,transcriptHash:l}}function Q6(t){return Z6({localSecretKey:t.deviceSecretKey,peerPublicKey:t.daemonPublicKey,daemonPublicKey:t.daemonPublicKey,devicePublicKey:t.devicePublicKey,pairingSecret:t.pairingSecret,sessionSalt:t.sessionSalt,ids:t.ids})}function J6(){return Px(vm)}function eD(t){gn(t.rootD2p,Ka,"rootD2p"),gn(t.rootP2d,Ka,"rootP2d"),gn(t.phoneConnSalt,vm,"phoneConnSalt"),gn(t.daemonConnSalt,vm,"daemonConnSalt");const a=zn(Jt(B6),t.phoneConnSalt,t.daemonConnSalt),o=zn(Uint8Array.of(0),Dc(t.ids.protocolVersion),mc(Jt(t.ids.daemonId)),mc(Jt(t.ids.deviceId)),t.phoneConnSalt,t.daemonConnSalt),i=ai(ko,t.rootD2p,a,zn(Jt(z6),o),Ka),l=ai(ko,t.rootP2d,a,zn(Jt(H6),o),Ka);return{d2p:i,p2d:l}}function tD(t,a){gn(t,32,"transcriptHash");const o=ai(ko,t,Jt(g1),zn(Jt(M6),Uint8Array.of(0),Dc(a.protocolVersion)),4);return(ap(o)%1e6).toString().padStart(R6,"0")}function y1(t,a,o){if(!Number.isInteger(a)||a<0||a>4294967295)throw new RangeError(`streamId out of range: ${a}`);const i=new Uint8Array(A6);return i[0]=t==="d2p"?U6:W6,i.set(Dc(a),1),i.set(F6(o),8),i}function b1(t){if(t.length<v1)throw new RangeError("headerBytes too short");return ap(t,I6)}function Mc(t){if(t.length<v1)throw new RangeError("headerBytes too short");return ap(t,q6)}function nD(t){gn(t.key,Ka,"key");const a=b1(t.headerBytes),o=Mc(t.headerBytes),i=y1(t.direction,a,o);return Kx(t.key,i,t.headerBytes).encrypt(t.payload)}function aD(t){gn(t.key,Ka,"key");const a=b1(t.headerBytes),o=Mc(t.headerBytes),i=y1(t.direction,a,o);return Kx(t.key,i,t.headerBytes).decrypt(t.ciphertext)}function rD(t){return{direction:t,nextSeq:0}}function oD(t){return{direction:t,lastSeq:-1}}function sD(t,a){const o=Mc(a.headerBytes);if(o!==t.nextSeq)throw new RangeError(`header seq ${o} does not match sealer.nextSeq ${t.nextSeq}`);const i=nD({key:a.key,direction:t.direction,headerBytes:a.headerBytes,payload:a.payload}),l=t.nextSeq;return t.nextSeq+=1,{seq:l,ciphertext:i}}function iD(t,a){if(a.seq!==t.lastSeq+1)throw new RangeError("out-of-order or replayed frame");if(Mc(a.headerBytes)!==a.seq)throw new RangeError("out-of-order or replayed frame");const i=aD({key:a.key,direction:t.direction,headerBytes:a.headerBytes,ciphertext:a.ciphertext});return t.lastSeq=a.seq,i}const lD=(t,a)=>{const o=new URL(t);if(o.protocol==="https:"?o.protocol="wss:":o.protocol==="http:"&&(o.protocol="ws:"),o.protocol!=="wss:"&&o.protocol!=="ws:")throw new Error(`unsupported pairing gateway protocol: ${o.protocol}`);return`${o.toString().replace(/\/+$/,"")}/relay/pair?daemonId=${encodeURIComponent(a)}`},cD=t=>typeof t=="object"&&t!==null&&typeof t.t=="string",uD=2e4,dD=1e4;function fD(t,a,o){const i=o.generateKeyPair??V6,l=o.generateSalt??X6,u=o.heartbeatMs??uD,f=o.heartbeatDeadlineMs??dD;let p="idle",g=null,m=null,b=null,v=!1,k=null,S=null,E=null,w=null,C=null,T=null,N="",A="",j=null;const O=F=>{p=F,a.onPhase(F)},D=()=>{S!==null&&(clearTimeout(S),S=null)},L=()=>{k!==null&&(clearInterval(k),k=null),D()},q=F=>{L(),k=setInterval(()=>{if(!v){try{F.send(Wx)}catch{}S===null&&(S=setTimeout(()=>{if(S=null,!v){try{F.close()}catch{}V()}},f))}},u)},$=()=>{E?.secretKey.fill(0),w?.fill(0),C&&(C.d2p.fill(0),C.p2d.fill(0),C.transcriptHash.fill(0)),E=null,w=null,C=null},ae=F=>{if(!v){v=!0,L(),$();try{b?.close()}catch{}b=null,j?.(F)}},G=(F,R)=>{if(v)return;const B={code:F,message:R};O(F==="rejected"?"rejected":F==="expired"?"expired":"error"),a.onFailure(B),ae({ok:!1,failure:B})},W=F=>{if(p!=="connecting"&&p!=="handshaking")return;if(F.protocolVersion!==Sn){G("protocol_version",`unsupported pairing protocol version ${F.protocolVersion}`);return}if(!E||!w){G("pair_ack_invalid","pair-ack arrived before the phone keypair was ready");return}let R;try{R=ri(F.daemonPublicKey)}catch{G("pair_ack_invalid","pair-ack daemonPublicKey is not valid base64url");return}const B={daemonId:F.daemonId,deviceId:F.deviceId,protocolVersion:F.protocolVersion};try{C=Q6({deviceSecretKey:E.secretKey,daemonPublicKey:R,devicePublicKey:E.publicKey,pairingSecret:I,sessionSalt:w,ids:B})}catch(se){G("pair_ack_invalid",`handshake derivation failed: ${se.message}`);return}m=F.deviceId,A=F.daemonId,T=F.daemonPublicKey,g=C.sas,O("awaiting_confirm"),a.onSas(g)},ee=()=>{if(!v){if(!C||!E||!m){G("pair_ack_invalid","cannot mint before the handshake produced a session");return}O("minting"),o.mintSession(N,{daemonId:A,deviceId:m}).then(()=>{if(v||!E||!T||!m||!C)return;const F={v:2,gatewayUrl:N,daemonId:A,deviceId:m,deviceKeyPair:G6(E),daemonPublicKey:T,rootKeys:{d2p:kr(C.d2p),p2d:kr(C.p2d)},protocolVersion:Sn,pairedAt:(o.now??Date.now)()};o.store.save(F);const R=m;O("paired"),ae({ok:!0,deviceId:R})}).catch(F=>{F.status===403?G("mint_forbidden","gateway refused to mint a device session (not confirmed)"):G("mint_failed",`device session mint failed: ${F.message??"unknown"}`)})}},Q=F=>{if(p==="awaiting_confirm"){if(!C||!E||!m||F.deviceId!==m){G("pair_ack_invalid","confirmed for an unexpected device");return}ee()}},V=()=>{if(!v){if(p==="awaiting_confirm"){ee();return}p!=="minting"&&G("socket_closed","pairing socket closed before the device was paired")}},M=F=>{if(v||typeof F!="string")return;if(F===Ix){D();return}let R;try{R=JSON.parse(F)}catch{return}if(cD(R))switch(p==="connecting"&&R.t==="pair-ack"&&O("handshaking"),R.t){case"pair-ack":W(R);break;case"confirmed":Q(R);break;case"rejected":{const B=R.reason;B==="expired"||B==="pairing_expired"?G("expired","pairing code expired; generate a new pairing code"):G("rejected",B??"pairing rejected at the desktop")}break}},P=$6(t),I=ri(P.pairingSecret);return N=P.gatewayUrl,A=P.daemonId,{get phase(){return p},get sas(){return g},get deviceId(){return m},start:()=>v?Promise.resolve({ok:!1,failure:{code:"cancelled",message:"already settled"}}):new Promise(F=>{j=F,E=i(),w=l(),O("connecting");const R=lD(P.gatewayUrl,P.daemonId);try{b=o.openSocket(R)}catch(B){G("socket_closed",`failed to open pairing socket: ${B.message}`);return}b.addEventListener("open",()=>{if(v||!b||!E||!w)return;q(b);const B={t:"hello",devicePublicKey:kr(E.publicKey),sessionSalt:kr(w),...o.proposedName?{proposedName:o.proposedName}:{},...o.boundJti?{boundJti:o.boundJti}:{}};b?.send(JSON.stringify(B))}),b.addEventListener("message",B=>{M(B.data)}),b.addEventListener("close",V),b.addEventListener("error",V)}),cancel:()=>{v||(O("rejected"),G("cancelled","pairing cancelled"))},dispose:()=>{v?$():ae({ok:!1,failure:{code:"cancelled",message:"disposed"}})}}}const mD=t=>async(a,o)=>{const i=await t(`${a}/pair/session`,{method:"POST",credentials:"include",headers:{"content-type":"application/json"},body:JSON.stringify(o)});if(!i.ok)throw Object.assign(new Error(`mint failed: ${i.status}`),{status:i.status})};function pD(t){const a=t.fetchImpl??globalThis.fetch.bind(globalThis),o=t.gatewayBaseUrl??window.location.origin,i=t.redirect??(E=>window.location.assign(E)),l=t.createPairing??fD,u=t.mintSession??mD(a);let f=t.authProvider??"github",p="login",g=null;const m=E=>{p=E,t.onPhase?.(E)},b=E=>t.store.load(o,E),v=async E=>{E&&(f=E);const w=await a(`${o}/pair/machines`,{credentials:"include"});if(w.status===401){const N=encodeURIComponent(window.location.pathname+window.location.search);return m("login"),i(`${o}/auth/${f}?redirect=${N}`),{daemons:[],selfDeviceId:null}}if(!w.ok)throw new Error(`Failed to load machines: ${w.status}`);const C=await w.json(),T=C.daemons.map(N=>({id:N.id,name:N.name,lastSeen:N.lastSeen,revoked:N.revoked,online:N.online}));return m("machines"),{daemons:T,selfDeviceId:C.self.deviceId}},k=E=>{m("pairing");const C=l(E,{onPhase:T=>t.onPairingPhase?.(T),onSas:T=>t.onPairingSas?.(T),onFailure:T=>t.onPairingFailure?.(T)},{openSocket:(T,N)=>new WebSocket(T,N),store:t.store,mintSession:u,...t.proposedName?{proposedName:t.proposedName}:{},...t.boundJti?{boundJti:t.boundJti}:{}});return g=C,C.start()};return{get phase(){return p},get pairingClient(){return g},loadMachines:v,selectDaemon:async(E,w)=>{g=null;const C=b(E);if(C&&!w){const j=await t.connectTransport({daemonId:E,deviceId:C.deviceId,stored:C});return j.ok?(m("connected"),j):(!j.ok&&j.failure.code==="relay_revoked"&&t.store.clear(o,E),m("selecting"),j)}if(m("selecting"),!w)return{ok:!1,failure:{code:"needs_pairing",message:"this device is not paired with that computer — enter its pairing code first"}};const T=await k(w);if(!T.ok)return T;const N=b(E),A=await t.connectTransport({daemonId:E,deviceId:T.deviceId,stored:N});return A.ok?(m("connected"),A):(A.failure.code==="relay_revoked"&&t.store.clear(o,E),m("selecting"),A)}}}const w1="0123456789ABCDEFGHJKMNPQRSTVWXYZ",hD=12,gD="hive-remote-pairing-code-v1:",vD=t=>{const a=t.trim().toUpperCase().replace(/[\s-]+/g,"").replace(/O/g,"0").replace(/[IL]/g,"1");if(a.length!==hD)return null;for(const o of a)if(!w1.includes(o))return null;return a},yD=new TextEncoder,bD=t=>new URL(t).origin,wD=async t=>{const a=vD(t.code);if(!a)return null;const o=await crypto.subtle.digest("SHA-256",yD.encode(`${gD}${a}`));return Y6({v:Sn,gatewayUrl:bD(t.gatewayUrl),daemonId:t.daemonId,pairingSecret:kr(new Uint8Array(o))})},xD="hive.device-session.v2",kD="hive.device-session.v1",If=(t,a)=>`${xD}:${t}:${a}`,Bb=(t,a)=>`${kD}:${t}:${a}`,SD=t=>{if(typeof t!="object"||t===null)return!1;const a=t;if(a.v!==2||typeof a.gatewayUrl!="string"||typeof a.daemonId!="string"||typeof a.deviceId!="string"||typeof a.daemonPublicKey!="string"||typeof a.protocolVersion!="number"||typeof a.pairedAt!="number")return!1;const o=a.deviceKeyPair;if(typeof o!="object"||o===null)return!1;const i=o;if(typeof i.secretKey!="string"||typeof i.publicKey!="string")return!1;const l=a.rootKeys;if(typeof l!="object"||l===null)return!1;const u=l;return typeof u.d2p=="string"&&typeof u.p2d=="string"},ED=(t=globalThis.localStorage??null)=>({load:(a,o)=>{if(!t)return null;t.getItem(Bb(a,o))!==null&&t.removeItem(Bb(a,o));const i=t.getItem(If(a,o));if(i===null)return null;try{const l=JSON.parse(i);return SD(l)?l:null}catch{return null}},save:a=>{t&&t.setItem(If(a.gatewayUrl,a.daemonId),JSON.stringify(a))},clear:(a,o)=>{t&&t.removeItem(If(a,o))}}),x1=()=>{const t=window.location.hostname;return!(t==="127.0.0.1"||t==="localhost"||t==="[::1]"||t==="::1")},k1=t=>{switch(t){case"rejected":case"cancelled":return"pairing.failed.rejected";case"expired":return"pairing.failed.expired";case"mint_forbidden":return"pairing.failed.mintForbidden";case"protocol_version":return"pairing.failed.version";case"socket_closed":case"pair_ack_invalid":case"mint_failed":return"pairing.failed.socket";default:return null}},CD=(t,a)=>{const o=k1(a);if(o)return o;switch(t){case"connecting":return"pairing.connecting";case"handshaking":case"minting":return"pairing.handshaking";case"awaiting_confirm":return null;case"paired":return"pairing.paired";case"rejected":return"pairing.failed.rejected";case"expired":return"pairing.failed.expired";case"error":return"pairing.failed.socket";default:return null}},TD=t=>t==="select_failed"?"connect.error.selectFailed":t==="invalid_code"?"connect.error.invalidCode":t==="relay_revoked"?"connect.machines.revokedHint":null,ND=t=>{const a=Math.floor((Date.now()-t)/1e3);if(a<60)return null;const o=Math.floor(a/60);if(o<60)return`${o}m`;const i=Math.floor(o/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`},jD={O:"0",I:"1",L:"1"},_D=t=>{const a=t.toUpperCase();let o="";for(const l of a){const u=jD[l]??l;if(w1.includes(u)&&(o+=u,o.length===12))break}const i=[];for(let l=0;l<o.length;l+=4)i.push(o.slice(l,l+4));return i.join("-")},AD=t=>t==="minting"||t==="paired",Ul=({children:t,className:a="",testId:o})=>c.jsx("div",{"data-testid":o,className:`connect-screen flex min-h-full flex-col p-6 ${a}`,children:t}),Bs=({primary:t,children:a,disabled:o,onClick:i,testId:l,type:u="button"})=>c.jsx("button",{type:u,"data-testid":l,disabled:o,onClick:i,className:"flex w-full items-center justify-center rounded-lg px-4 text-sm font-semibold transition-colors",style:{minHeight:"44px",background:t?"var(--accent)":"var(--bg-2)",color:t?"#ffffff":"var(--text-secondary)",border:`1px solid ${t?"var(--accent)":"var(--border-bright)"}`,opacity:o?.4:1,cursor:o?"not-allowed":"pointer"},children:a}),RD=({flow:t,phase:a,machines:o,selectedMachineId:i,pairingPhase:l,pairingFailureCode:u,connectError:f,sas:p,isSigningIn:g=!1,pendingMachineId:m,loginError:b=!1,isGatewayBundle:v=!1,onRefreshMachines:k,onSelectProvider:S,onSelectMachine:E,onSubmitCode:w,onCancelPairing:C,onGoBack:T})=>{const{t:N}=Se(),[A,j]=y.useState(""),O=y.useRef(!1),D=CD(l,u),L=TD(f),q=k1(u)!=null,$=AD(l),ae=p!=null&&p.length>0&&(l==="awaiting_confirm"||$),G=V=>{const M=_D(V);j(M),M.replace(/-/g,"").length===12&&i&&!O.current&&(O.current=!0,w(i,M.trim()))},W=A.replace(/-/g,"").length===12,ee=!!i&&W,Q=v?"/brand/icon-192.png":"/logo.png";if(a==="login")return c.jsxs(Ul,{testId:"connect-login",className:"justify-center gap-6",children:[c.jsxs("div",{className:"mb-2 flex flex-col items-center gap-3 text-center",children:[c.jsx("img",{src:Q,width:72,height:72,alt:"",style:{filter:"drop-shadow(0 8px 28px rgba(51,88,212,.38))"}}),c.jsx("span",{className:"text-2xl font-bold tracking-tight",style:{color:"var(--text-primary)"},children:"Hive"})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("h1",{className:"text-xl font-semibold text-pri",children:N("connect.login.heading")}),c.jsx("p",{className:"mt-2 text-sm text-ter",children:N("connect.login.subtitle")})]}),b?c.jsx("p",{"data-testid":"connect-login-error",className:"rounded-lg px-3 py-2 text-center text-sm",style:{background:"color-mix(in oklab, var(--status-red) 12%, transparent)",color:"var(--status-red)"},children:N("connect.login.failed")}):null,c.jsx("div",{className:"flex flex-col gap-3",children:g?c.jsx("div",{className:"flex items-center justify-center text-sm text-ter",style:{minHeight:"44px"},children:N("connect.login.signingIn")}):c.jsxs(c.Fragment,{children:[c.jsx(Bs,{primary:!0,testId:"connect-login-github",onClick:()=>S("github"),children:N("connect.login.github")}),c.jsx(Bs,{testId:"connect-login-google",onClick:()=>S("google"),children:N("connect.login.google")})]})})]});if(a==="machines"){const V=m!=null;return c.jsxs(Ul,{testId:"connect-machines",className:"gap-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("img",{src:Q,width:20,height:20,alt:"",className:"shrink-0"}),c.jsx("span",{className:"text-sm font-semibold text-sec",children:"Hive"})]}),c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("h1",{className:"text-xl font-semibold text-pri",children:N("connect.machines.heading")}),k?c.jsx("button",{type:"button","aria-label":N("common.refresh"),"data-testid":"connect-machines-refresh",onClick:k,className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md text-sec",style:{background:"var(--bg-2)",border:"1px solid var(--border-bright)"},children:c.jsx(Cm,{size:16,"aria-hidden":!0})}):null]}),L?c.jsx("p",{"data-testid":"connect-error",className:"rounded-lg px-3 py-2 text-sm",style:{background:"color-mix(in oklab, var(--status-red) 12%, transparent)",color:"var(--status-red)"},children:N(L)}):null,o.length===0?c.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 px-4 text-center",children:[c.jsx("span",{className:"flex h-16 w-16 items-center justify-center rounded-2xl",style:{background:"color-mix(in oklab, var(--accent) 12%, transparent)",color:"var(--accent-hover, var(--accent))"},"aria-hidden":!0,children:c.jsx(nf,{size:28})}),c.jsx("p",{"data-testid":"connect-machines-empty",className:"max-w-[280px] text-sm text-ter",children:N("connect.machines.empty")}),c.jsx("div",{className:"flex w-full max-w-[320px] flex-col gap-3 pt-2",children:c.jsx(Bs,{testId:"connect-machines-back",...T?{onClick:T}:{},children:N("connect.machines.back")})})]}):c.jsx("ul",{className:"flex flex-col gap-2.5",children:o.map(M=>{const P=m===M.id,I=!M.online||M.revoked||V;let Z,F="var(--text-tertiary)";if(M.revoked)Z=N("connect.machines.revoked"),F="var(--status-red)";else if(M.online)P?(Z=N("connect.machines.connecting"),F="var(--text-secondary)"):(Z=N("connect.machines.online"),F="var(--status-green)");else{const B=M.lastSeen!=null?ND(M.lastSeen):null;Z=B!=null?N("connect.machines.lastSeen",{ago:B}):N("connect.machines.offline")}const R=M.revoked?"var(--status-red)":M.online?"var(--status-green)":"var(--text-tertiary)";return c.jsx("li",{children:c.jsxs("button",{type:"button","data-testid":`connect-machine-${M.id}`,className:"flex w-full items-center gap-3 rounded-xl border px-3.5 py-3 text-left transition-colors",style:{minHeight:"64px",borderColor:"var(--border-bright)",background:P?"var(--bg-2)":"var(--bg-1)",opacity:I&&!P?.55:1,cursor:I?"not-allowed":"pointer"},disabled:I,"aria-disabled":I,onClick:()=>E(M.id),children:[c.jsxs("span",{className:"relative shrink-0","aria-hidden":!0,children:[c.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-lg",style:{background:"color-mix(in oklab, var(--accent) 12%, transparent)",color:"var(--accent-hover, var(--accent))"},children:c.jsx(nf,{size:20})}),c.jsx("span",{className:"absolute -right-0.5 -bottom-0.5 h-3 w-3 rounded-full border-2",style:{background:R,borderColor:"var(--bg-1)"}})]}),c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsx("span",{className:"block truncate text-[15px] font-medium text-pri",children:M.name}),c.jsx("span",{className:"mt-0.5 block text-xs",style:{color:F},children:Z})]}),P?c.jsx("span",{"aria-hidden":!0,className:"h-4 w-4 shrink-0 animate-spin rounded-full border-2",style:{borderColor:"var(--border-bright)",borderTopColor:"var(--accent)"}}):I?null:c.jsx(vc,{size:18,className:"shrink-0 text-ter","aria-hidden":!0})]})},M.id)})}),v?c.jsx("div",{className:"mt-auto pt-4 text-center",children:c.jsx("a",{href:"/machines",className:"text-xs underline-offset-2 hover:underline",style:{color:"var(--text-tertiary)"},children:N("connect.machines.manageDevices")})}):null]})}if(a==="selecting"){const V=o.find(M=>M.id===i);return c.jsxs(Ul,{testId:"connect-pair-guide",className:"gap-4",children:[c.jsxs("button",{type:"button",className:"-ml-2 flex items-center gap-1 self-start rounded-md px-2 text-sm text-sec",style:{minHeight:"44px"},onClick:T,children:[c.jsx(TS,{size:16,"aria-hidden":!0}),N("connect.pair.back")]}),c.jsxs("div",{children:[c.jsx("h1",{className:"text-xl font-semibold text-pri",children:N("connect.pair.guideHeading")}),V?c.jsxs("p",{className:"mt-1 flex items-center gap-1.5 text-sm text-ter",children:[c.jsx(nf,{size:14,"aria-hidden":!0,className:"shrink-0"}),c.jsx("span",{className:"truncate",children:V.name})]}):null]}),L?c.jsx("p",{"data-testid":"connect-error",className:"rounded-lg px-3 py-2 text-sm",style:{background:"color-mix(in oklab, var(--status-red) 12%, transparent)",color:"var(--status-red)"},children:N(L)}):null,c.jsx("ol",{className:"flex flex-col gap-3",children:["connect.pair.guideStep1","connect.pair.guideStep2","connect.pair.guideStep3"].map((M,P)=>c.jsxs("li",{className:"flex items-start gap-3 text-sm text-sec",children:[c.jsx("span",{"aria-hidden":!0,className:"mt-px flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-lg text-xs font-semibold",style:{background:"color-mix(in oklab, var(--accent) 13%, transparent)",border:"1px solid color-mix(in oklab, var(--accent) 34%, transparent)",color:"var(--accent-hover)"},children:P+1}),c.jsx("span",{className:"min-w-0 leading-relaxed",children:N(M)})]},M))}),c.jsxs("label",{className:"flex flex-col gap-2 text-xs uppercase tracking-wider text-ter",children:[N("connect.pair.qrLabel"),c.jsx("input",{type:"text","data-testid":"connect-code-input",className:"input mono text-center",inputMode:"text",autoCapitalize:"characters",autoCorrect:"off",autoComplete:"off",spellCheck:!1,placeholder:"XXXX-XXXX-XXXX",maxLength:14,value:A,onChange:M=>{O.current=!1,G(M.target.value)},style:{fontSize:"18px",letterSpacing:"0.12em",minHeight:"52px"}})]}),c.jsx(Bs,{primary:!0,testId:"connect-code-submit",disabled:!ee,onClick:()=>{i&&!O.current&&(O.current=!0,w(i,A.trim()))},children:N("connect.pair.submit")})]})}if(a==="pairing"){const V=q;return c.jsxs(Ul,{testId:"connect-pairing",className:"justify-center gap-6",children:[ae&&!V?c.jsxs("div",{className:"flex flex-col items-center gap-4",children:[c.jsx("div",{"data-testid":"connect-pairing-sas",className:"mono rounded-2xl border px-7 py-5 font-bold text-pri","aria-live":"polite",style:{fontSize:"2.5rem",letterSpacing:"0.25em",paddingRight:"calc(1.75rem - 0.25em)",background:"var(--bg-1)",borderColor:"var(--border-bright)"},children:p}),c.jsx("p",{className:"text-center text-sm text-ter",style:{maxWidth:"280px"},children:N($?"connect.pair.finalizing":"connect.pair.sasInstruction")}),$?c.jsx("span",{"aria-hidden":!0,className:"h-5 w-5 animate-spin rounded-full border-2",style:{borderColor:"var(--border-bright)",borderTopColor:"var(--accent)"}}):null]}):null,D&&!ae&&!V?c.jsx("p",{"data-testid":"connect-pairing-phase",className:"text-center text-sm text-ter",children:N(D)}):null,V&&D?c.jsx("p",{"data-testid":"connect-pairing-phase",className:"text-center text-sm",style:{color:"var(--status-red)"},children:N(D)}):null,$?null:c.jsx("div",{className:"flex flex-col gap-3",children:c.jsx(Bs,{primary:V,testId:"connect-pairing-cancel",onClick:()=>{j(""),O.current=!1,C?C():t.pairingClient?.cancel()},children:N(V?"connect.pair.startOver":"common.cancel")})})]})}return null},OD=()=>{if(typeof navigator>"u")return"Phone";const t=navigator.userAgent??"";let a="Phone";/iPad/.test(t)?a="iPad":/iPhone/.test(t)?a="iPhone":/Android/.test(t)&&(a="Android");let o="Browser";return/EdgA?\//.test(t)?o="Edge":/SamsungBrowser\//.test(t)?o="Samsung":/OPR\/|OPT\//.test(t)?o="Opera":/Firefox\//.test(t)?o="Firefox":/Chrome\//.test(t)?o="Chrome":/Safari\//.test(t)&&(o="Safari"),`${a} · ${o}`.slice(0,48)},DD=({children:t,connectTransport:a,createFlow:o=pD,store:i,gatewayBaseUrl:l,isGateway:u=x1})=>{const f=u(),[p,g]=y.useState("login"),[m,b]=y.useState([]),[v,k]=y.useState(null),[S,E]=y.useState(void 0),[w,C]=y.useState(null),[T,N]=y.useState(null),[A,j]=y.useState(null),[O,D]=y.useState(null),[L,q]=y.useState(!1),[$,ae]=y.useState(null),[G,W]=y.useState(!1),[ee,Q]=y.useState(!0),V=y.useMemo(()=>o({store:i??ED(),connectTransport:a,...l?{gatewayBaseUrl:l}:{},proposedName:OD(),onPhase:g,onPairingPhase:ue=>{C(ue),ue!=="error"&&ue!=="expired"&&ue!=="rejected"&&N(null)},onPairingSas:D,onPairingFailure:ue=>N(ue.code)}),[o,i,a,l]),M=y.useRef(V);M.current=V;const P=y.useRef(0),I=y.useCallback(()=>{C(null),N(null),D(null)},[]),Z=y.useCallback(()=>(P.current+=1,P.current),[]),F=y.useCallback(ue=>P.current===ue,[]);y.useEffect(()=>{let ue=!1;return M.current.loadMachines().then(({daemons:ie,selfDeviceId:le})=>{ue||(b(ie),k(le))}).catch(()=>{}).finally(()=>{ue||Q(!1)}),()=>{ue=!0}},[]);const R=y.useCallback(()=>{const ue=Z();j(null),I(),q(!0),M.current.loadMachines().then(({daemons:ie,selfDeviceId:le})=>{F(ue)&&(b(ie),k(le))}).finally(()=>{F(ue)&&q(!1)})},[I,F,Z]),B=y.useCallback(ue=>{const ie=Z();j(null),I(),W(!1),q(!0),M.current.loadMachines(ue).then(({daemons:le,selfDeviceId:ce})=>{F(ie)&&(b(le),k(ce))}).catch(()=>{F(ie)&&W(!0)}).finally(()=>{F(ie)&&q(!1)})},[I,F,Z]),se=y.useCallback(ue=>{const ie=Z();E(ue),j(null),I(),ae(ue),(async()=>{const le=await M.current.selectDaemon(ue);F(ie)&&(ae(null),!le.ok&&le.failure.code==="select_failed"&&j("select_failed"),!le.ok&&le.failure.code==="relay_revoked"&&j("relay_revoked"))})()},[I,F,Z]),te=y.useCallback((ue,ie)=>{const le=Z();j(null),I(),(async()=>{const ce=await wD({code:ie,daemonId:ue,gatewayUrl:l??window.location.origin});if(!F(le))return;if(!ce){j("invalid_code");return}const de=await M.current.selectDaemon(ue,ce);F(le)&&(!de.ok&&de.failure.code==="select_failed"&&j("select_failed"),!de.ok&&de.failure.code==="relay_revoked"&&j("relay_revoked"))})()},[I,l,F,Z]),fe=y.useCallback(()=>{Z(),M.current.pairingClient?.cancel(),I(),j(null),g(S?"selecting":"machines")},[I,Z,S]),me=y.useCallback(()=>{Z(),j(null),I(),g("machines")},[I,Z]);return p==="connected"?(typeof history<"u"&&history.replaceState(null,"","/app"),c.jsx(c.Fragment,{children:t})):ee?c.jsxs("div",{className:"connect-screen flex min-h-full flex-col items-center justify-center gap-3 p-6",children:[c.jsx("img",{src:f?"/brand/icon-192.png":"/logo.png",width:56,height:56,alt:"",className:"animate-pulse"}),c.jsx("span",{className:"sr-only","aria-live":"polite",children:"…"})]}):c.jsx(RD,{flow:V,phase:p,machines:m,selfDeviceId:v,...S?{selectedMachineId:S}:{},pairingPhase:w,pairingFailureCode:T,connectError:A,sas:O,isSigningIn:L,pendingMachineId:$,loginError:G,isGatewayBundle:f,onRefreshMachines:R,onSelectProvider:B,onSelectMachine:se,onSubmitCode:te,onCancelPairing:fe,onGoBack:me})},MD=(t,a,o)=>t.mode==="tunnel"?c.jsx(o,{connectTransport:t.connectTransport,children:c.jsx(a,{})}):c.jsx(a,{}),Ge={Open:1,Data:2,End:3,Reset:4,Ping:5,Ack:6},pc={Http:1,Ws:2},Ut={ProtocolError:1,VersionMismatch:4},Ub={INITIAL_WINDOW:256*1024,ACK_THRESHOLD:32*1024},hc=12,Wb=0,ym=4294967295,S1=4294967295,LD=0,E1=1;class Wt extends Error{code;constructor(a,o){super(a),this.name="ProtocolError",this.code=o}}const zD=new TextEncoder,HD=new TextDecoder;function C1(t){return zD.encode(t)}function Lc(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function bm(t,a){if(!Number.isInteger(t)||t<0||t>S1)throw new RangeError(`${a} out of u32 range: ${t}`)}function T1(t){return t===Ge.Open||t===Ge.Data||t===Ge.End||t===Ge.Reset||t===Ge.Ping||t===Ge.Ack}function N1(t){return(t&-2)===0}function Ib(t){if(t.version!==Sn)throw new RangeError(`version must be ${Sn}`);if(!T1(t.kind))throw new RangeError(`unknown kind: ${t.kind}`);if(!Number.isInteger(t.flags)||t.flags<0||t.flags>65535)throw new RangeError(`flags out of u16 range: ${t.flags}`);if(t.kind===Ge.Data){if(!N1(t.flags))throw new RangeError("reserved flag bits set on Data frame")}else if(t.flags!==0)throw new RangeError("flags must be 0 on a non-Data frame");bm(t.streamId,"streamId"),bm(t.seq,"seq");const a=new Uint8Array(hc),o=Lc(a);return o.setUint8(0,t.version),o.setUint8(1,t.kind),o.setUint16(2,t.flags),o.setUint32(4,t.streamId),o.setUint32(8,t.seq),a}function BD(t){if(t.length<hc)throw new Wt("header too short",Ut.ProtocolError);const a=Lc(t),o=a.getUint8(0);if(o!==Sn)throw new Wt(`bad version ${o}`,Ut.VersionMismatch);const i=a.getUint8(1);if(!T1(i))throw new Wt(`unknown kind ${i}`,Ut.ProtocolError);const l=a.getUint16(2);if(i===Ge.Data){if(!N1(l))throw new Wt("reserved flag bits set on Data frame",Ut.ProtocolError)}else if(l!==0)throw new Wt("flags must be 0 on a non-Data frame",Ut.ProtocolError);const u=a.getUint32(4),f=a.getUint32(8);return{version:o,kind:i,flags:l,streamId:u,seq:f}}function qb(t){let a;if(t.transport===pc.Http){if(!t.http)throw new RangeError("http meta required for Http transport");a=t.http}else if(t.transport===pc.Ws){if(!t.ws)throw new RangeError("ws meta required for Ws transport");a=t.ws}else throw new RangeError(`unknown transport: ${t.transport}`);const o=C1(JSON.stringify(a));if(o.length>65535)throw new RangeError("open meta too large");const i=new Uint8Array(3+o.length);return i[0]=t.transport,Lc(i).setUint16(1,o.length),i.set(o,3),i}function UD(t){if(!Array.isArray(t))return!1;for(const a of t)if(!Array.isArray(a)||a.length!==2||typeof a[0]!="string"||typeof a[1]!="string")return!1;return!0}const zc={ConnSalt:1,Hello:2},wm={daemon:1,device:2},WD=34;function ID(t){if(t.salt.length!==32)throw new RangeError(`conn salt must be 32 bytes, got ${t.salt.length}`);const a=new Uint8Array(34);return a[0]=zc.ConnSalt,a[1]=wm.device,a.set(t.salt,2),a}function qD(t){if(t.length!==WD)throw new Wt("conn salt must be 34 bytes",Ut.ProtocolError);if(t[0]!==zc.ConnSalt)throw new Wt("not a ConnSalt frame",Ut.ProtocolError);const a=t[1],o=a===wm.daemon?"daemon":a===wm.device?"device":null;if(o===null)throw new Wt("bad conn salt role",Ut.ProtocolError);return{role:o,salt:t.slice(2)}}function PD(t){return t.length>=1&&t[0]===zc.ConnSalt}function FD(t){if(t.role!=="daemon"&&t.role!=="device")throw new RangeError(`bad role: ${t.role}`);const a=C1(JSON.stringify(t)),o=new Uint8Array(1+a.length);return o[0]=zc.Hello,o.set(a,1),o}function KD(t){bm(t,"cumulativeBytes");const a=new Uint8Array(4);return Lc(a).setUint32(0,t),a}function YD(t,a){const o=new Uint8Array(1+t.length);return o[0]=a?1:0,o.set(t,1),o}function $D(t){if(t.length<1)throw new Wt("ws message too short",Ut.ProtocolError);const a=t[0];if(a!==0&&a!==1)throw new Wt("bad ws isText flag",Ut.ProtocolError);return{data:t.slice(1),isText:a===1}}function Pb(t){const a=new Uint8Array(1+t.length);return a[0]=E1,a.set(t,1),a}function VD(t){if(t.length<1)throw new Wt("http data too short",Ut.ProtocolError);const a=t[0];if(a===LD){let o;try{o=JSON.parse(HD.decode(t.subarray(1)))}catch{throw new Wt("http head not JSON",Ut.ProtocolError)}const i=o;if(typeof i.status!="number"||!UD(i.headers))throw new Wt("bad http head",Ut.ProtocolError);return{kind:"head",head:{status:i.status,headers:i.headers}}}if(a===E1)return{kind:"body",data:t.slice(1)};throw new Wt(`unknown http disc ${a}`,Ut.ProtocolError)}function Fb(t){let a=1;return()=>{a===ym&&(a+=2);const o=a;if(a+=2,a>S1)throw new RangeError("stream id space exhausted; re-handshake required");return o}}const GD={ok:!0};function Kb(t=Ub.INITIAL_WINDOW,a=Ub.ACK_THRESHOLD){let o=0,i=0,l=0,u=0;const f=()=>o-i,p=()=>f()>=t;return{trySend(g){return f()+g>t?{ok:!1,reason:"WindowExhausted"}:(o+=g,GD)},applyAck(g){const m=p();return g<=i?{resumed:!1}:(i=Math.min(g,o),{resumed:m&&!p()})},onConsume(g){return l+=g,l-u>=a?(u=l,{ackCumulative:l}):null},flushAck(){return u=l,{ackCumulative:l}},isPaused:()=>p()}}const XD=1,qf=256*1024,xm=new TextEncoder,ZD=new TextDecoder,QD=t=>{let a=0;for(const l of t)a+=l.length;const o=new Uint8Array(a);let i=0;for(const l of t)o.set(l,i),i+=l.length;return o},JD=t=>{if(typeof t=="string")return{bytes:xm.encode(t),isText:!0};if(t instanceof Uint8Array)return{bytes:t,isText:!1};if(t instanceof ArrayBuffer)return{bytes:new Uint8Array(t),isText:!1};const a=t;return{bytes:new Uint8Array(a.buffer,a.byteOffset,a.byteLength),isText:!1}},eM=t=>{const a=t.generateConnSalt??J6;let o=null,i=null,l=null,u=null,f=null,p=Fb();const g=new Map,m=(A,j)=>{if(A.length!==j.length)return!1;for(let O=0;O<A.length;O++)if(A[O]!==j[O])return!1;return!0},b=(A,j,O,D=0)=>{if(!i||!o)throw new Error("frame-mux: seal before channel handshake complete");const L=Ib({version:Sn,kind:A,flags:D,streamId:j,seq:i.nextSeq});t.onSeal?.({key:o.p2d,direction:"p2d",headerBytes:L});const{ciphertext:q}=sD(i,{key:o.p2d,headerBytes:L,payload:O}),$=new Uint8Array(L.length+q.length);return $.set(L,0),$.set(q,L.length),$},v=()=>{t.send(b(Ge.Data,Wb,FD({protocolVersion:Sn,role:"device",daemonId:t.daemonId,deviceId:t.deviceId})))},k=A=>{u&&(f&&m(f,A)||(o=eD({rootD2p:t.roots.d2p,rootP2d:t.roots.p2d,phoneConnSalt:u,daemonConnSalt:A,ids:{daemonId:t.daemonId,deviceId:t.deviceId,protocolVersion:Sn}}),i=rD("p2d"),l=oD("d2p"),f=Uint8Array.from(A),v(),t.onReady?.()))},S=(A,j)=>{t.send(b(Ge.Ack,A,KD(j)))},E=(A,j)=>{if(!o)return Promise.reject(new Error("tunnel: channel not ready"));const O=p(),D=(j?.method??"GET").toUpperCase(),L=[];j?.headers&&new Headers(j.headers).forEach((G,W)=>{L.push([W,G])});const q=j?.body===void 0||j.body===null?void 0:tM(j.body),$=q!==void 0&&q.length>0;return new Promise((ae,G)=>{const W={kind:"http",body:[],recvFlow:Kb(),resolve:ae,reject:G,settled:!1};g.set(O,W),t.send(b(Ge.Open,O,qb({transport:pc.Http,http:{method:D,path:A,headers:L,hasBody:$}}))),$&&q?q.length<=qf?(t.send(b(Ge.Data,O,Pb(q))),t.send(b(Ge.End,O,new Uint8Array(0)))):w(O,W,q):t.send(b(Ge.End,O,new Uint8Array(0)))})},w=async(A,j,O)=>{try{for(let D=0;D<O.length;D+=qf){if(D>0&&t.awaitDrain&&await t.awaitDrain(),j.settled)return;t.send(b(Ge.Data,A,Pb(O.subarray(D,D+qf))))}if(j.settled)return;t.send(b(Ge.End,A,new Uint8Array(0)))}catch(D){if(j.settled)return;j.settled=!0,g.delete(A),j.reject(D)}},C=(A,j)=>{if(j.settled)return;j.settled=!0,g.delete(A);const O=j.head,D=QD(j.body);if(!O){j.reject(new Error("tunnel: stream ended without an HTTP head"));return}let L=null;if(D.length>0){const q=new ArrayBuffer(D.length);new Uint8Array(q).set(D),L=q}j.resolve(new Response(L,{status:O.status,headers:O.headers}))};class T{OPEN=1;readyState=0;onopen=null;onmessage=null;onclose=null;onerror=null;streamId;constructor(j){this.streamId=j}send(j){if(this.readyState!==this.OPEN)return;const{bytes:O,isText:D}=JD(j);t.send(b(Ge.Data,this.streamId,YD(O,D)))}close(j,O){if(this.readyState===3)return;const D=this.readyState===this.OPEN;this.readyState=3,D&&t.send(b(Ge.End,this.streamId,new Uint8Array(0))),g.delete(this.streamId)}_deliver(j,O){this.onmessage&&this.onmessage({data:O?ZD.decode(j):j})}_remoteClose(j,O){this.readyState!==3&&(this.readyState=3,g.delete(this.streamId),this.onclose?.(O===void 0?{code:j}:{code:j,reason:O}))}}return{beginChannel(){u=a(),o=null,i=null,l=null,f=null,this.resetAll("rekey"),p=Fb();const A=Ib({version:Sn,kind:Ge.Data,flags:0,streamId:ym,seq:0}),j=ID({salt:u}),O=new Uint8Array(A.length+j.length);O.set(A,0),O.set(j,A.length),t.send(O)},onFrame(A){const j=A.subarray(0,hc),O=A.subarray(hc),D=BD(j);if(D.streamId===ym&&PD(O)){const{role:$,salt:ae}=qD(O);$==="daemon"&&k(ae);return}if(!l||!o)return;const L=iD(l,{key:o.d2p,headerBytes:j,ciphertext:O,seq:D.seq});if(D.streamId===Wb)return;const q=g.get(D.streamId);if(q){if(q.kind==="http"){if(D.kind===Ge.Reset){q.settled||(q.settled=!0,g.delete(D.streamId),q.reject(new Error("tunnel: HTTP stream reset by daemon")));return}if(D.kind===Ge.Data){const $=VD(L);if($.kind==="head")q.head=$.head;else{q.body.push($.data);const ae=q.recvFlow.onConsume($.data.length);ae&&S(D.streamId,ae.ackCumulative)}(D.flags&XD)!==0&&C(D.streamId,q);return}if(D.kind===Ge.End){C(D.streamId,q);return}return}if(D.kind===Ge.Data){const $=$D(L),ae=q.recvFlow.onConsume($.data.length);ae&&S(D.streamId,ae.ackCumulative),q.socket._deliver($.data,$.isText);return}if(D.kind===Ge.End||D.kind===Ge.Reset){q.socket._remoteClose(D.kind===Ge.Reset?1011:1e3);return}}},fetch:E,openWebSocket:(A,j)=>{if(!o){const q=new T(-1);return queueMicrotask(()=>q._remoteClose(1011,"tunnel: channel not ready")),q}const O=p(),D=[];if(j)for(const[q,$]of Object.entries(j))$!==void 0&&D.push([q,String($)]);const L=new T(O);return g.set(O,{kind:"ws",recvFlow:Kb(),socket:L}),t.send(b(Ge.Open,O,qb({transport:pc.Ws,ws:D.length>0?{path:A,query:D}:{path:A}}))),queueMicrotask(()=>{L.readyState===0&&(L.readyState=L.OPEN,L.onopen?.())}),L},resetAll(A){for(const[j,O]of[...g.entries()])g.delete(j),O.kind==="http"?O.settled||(O.settled=!0,O.reject(new Error(`tunnel: connection lost (${A})`))):O.socket._remoteClose(1006,A)}}},tM=t=>typeof t=="string"?xm.encode(t):t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):xm.encode(String(t)),nM=2e4,aM=1e4,rM=6,oM=()=>{let t=0;return{next(){t+=1;const a=Math.min(3e4,500*2**(t-1));return Math.floor(a/2+Math.random()*(a/2))},reset(){t=0}}},sM=(t,a)=>!a&&(t===Sr.Forbidden||t===Sr.Unauthorized),iM=(t,a)=>{const o=t.WebSocketImpl??WebSocket,i=t.setTimer??((G,W)=>setTimeout(G,W)),l=t.clearTimer??(G=>clearTimeout(G)),u=t.backoff??oM(),f=t.heartbeatMs??nM,p=t.heartbeatDeadlineMs??aM,g=t.maxOfflineRetries??rM;let m=null,b=0,v=!1,k=!1,S=!1,E=0,w=null,C=null,T=null;const N=`${t.gatewayUrl}/relay?daemonId=${encodeURIComponent(t.daemonId)}`,A=()=>{T!==null&&(l(T),T=null)},j=()=>{C!==null&&(clearInterval(C),C=null),A()},O=(G,W)=>{j(),C=setInterval(()=>{if(G.readyState===G.OPEN){try{G.send(Wx)}catch{}T===null&&(T=i(()=>{if(T=null,!(W!==b||k)){j();try{G.close()}catch{}}},p))}},f)},D=()=>{if(k||v||S)return;const G=++b;let W=!1;const ee=new o(N,[`bearer.${t.phoneSessionToken}`]);ee.binaryType="arraybuffer",m=ee,ee.onopen=()=>{G!==b||k||(W=!0,u.reset(),E=0,O(ee,G),a.onUp())},ee.onmessage=Q=>{if(G!==b||k)return;const V=Q.data;if(typeof V=="string"){if(V.startsWith(vb)){let P;try{P=JSON.parse(V.slice(vb.length))}catch{return}if(P.t==="revoked"){L(Sr.Revoked),a.onControl(P);return}a.onControl(P);return}V===Ix&&A();return}const M=V instanceof ArrayBuffer?new Uint8Array(V):new Uint8Array(V);a.onFrame(M)},ee.onerror=()=>{},ee.onclose=Q=>{if(G!==b||k)return;j(),m=null;const V=Q.code??Sr.InternalError;if(f5(V)||sM(V,W)){L(V);return}if(V===Sr.DaemonOffline){if(E+=1,E>=g){S=!0,a.onDown({code:V,authFatal:!1,daemonOffline:!0});return}}else E=0;const M=u.next();a.onDown({code:V,authFatal:!1,nextRetryInMs:M}),w=i(()=>{w=null,D()},M)}},L=G=>{v||(v=!0,j(),w!==null&&(l(w),w=null),a.onDown({code:G,authFatal:!0}))},q=()=>{k||v||S||m!==null&&(m.readyState===m.OPEN||m.readyState===WebSocket.CONNECTING)||(w!==null&&(l(w),w=null),D())},$=()=>{typeof document<"u"&&document.visibilityState==="visible"&&q()},ae=()=>q();return typeof document<"u"&&document.addEventListener("visibilitychange",$),typeof window<"u"&&window.addEventListener("online",ae),D(),{send(G){m&&m.readyState===m.OPEN&&m.send(G)},bufferedAmount:()=>m&&m.readyState===m.OPEN?m.bufferedAmount:0,isOpen:()=>m!==null&&m.readyState===m.OPEN,resume(){k||v||!S||(S=!1,E=0,u.reset(),D())},close(){if(k=!0,b+=1,j(),w!==null&&(l(w),w=null),m){try{m.close()}catch{}m=null}typeof document<"u"&&document.removeEventListener("visibilitychange",$),typeof window<"u"&&window.removeEventListener("online",ae)}}};function lM(t){const a=t.session??t.persistedSession?.()??null;if(!a)throw new Error("createTunnelTransport: no session and persistedSession() returned null");let o={state:"connecting"};const i=(j,O)=>{o={state:j,...O?.reason?{reason:O.reason}:{},...O?.nextRetryInMs!==void 0?{nextRetryInMs:O.nextRetryInMs}:{},...O?.retry?{retry:O.retry}:{}},t.onStatus(o)};let l=null,u=!1,f=!1,p=!1;const g=new Set,m=t.setTimer??((j,O)=>setTimeout(j,O)),b=t.clearTimer??(j=>clearTimeout(j)),v=()=>{for(const j of g)j.timer!==null&&b(j.timer),j.resolve();g.clear()},k=j=>{for(const O of g)O.timer!==null&&b(O.timer),O.reject(new Error(`tunnel: ${j}`));g.clear()},S=()=>{u=!1},E=()=>{u||(p=!1,f=!1,u=!0,i("online"),v())},w=()=>{p=!0,u=!1,A.beginChannel()},C=4*1024*1024,T=50,N=()=>new Promise(j=>{const O=()=>{if(!l||l.bufferedAmount()<=C){j();return}m(O,T)};O()}),A=eM({roots:a.roots,daemonId:a.daemonId,deviceId:a.deviceId,send:j=>l?.send(j),onReady:E,awaitDrain:N});return l=iM({gatewayUrl:a.gatewayUrl,daemonId:a.daemonId,phoneSessionToken:a.phoneSessionToken,...t.WebSocketImpl?{WebSocketImpl:t.WebSocketImpl}:{},...t.setTimer?{setTimer:t.setTimer}:{},...t.clearTimer?{clearTimer:t.clearTimer}:{},...t.backoff?{backoff:t.backoff}:{}},{onFrame:j=>{try{A.onFrame(j)}catch{A.resetAll("frame_open_failed"),l?.close(),i("disconnected",{reason:"integrity"})}},onControl:j=>{if(j.t==="peer-offline"&&j.role==="daemon")f=!0,p=!1,S(),A.resetAll("peer_offline"),i("reconnecting");else if(j.t==="peer-online"&&j.role==="daemon"){if(u||p||!f)return;f=!1,w()}else j.t==="revoked"&&(f=!1,p=!1,S(),A.resetAll("revoked"),k(j.reason??"revoked"),i("revoked",{reason:j.reason}))},onUp:()=>{f=!1,w()},onDown:j=>{f=!1,p=!1,S(),A.resetAll(j.authFatal?"auth_fatal":j.daemonOffline?"daemon_offline":"transient"),j.authFatal?(k("auth_fatal"),i("revoked")):j.daemonOffline?(k("daemon_offline"),i("disconnected",{reason:"daemon_offline",retry:()=>l?.resume()})):i("reconnecting",j.nextRetryInMs!==void 0?{nextRetryInMs:j.nextRetryInMs}:void 0)}}),{requiresUiSession:!1,fetch:(j,O)=>A.fetch(j,O),openWebSocket:(j,O)=>A.openWebSocket(j,O),status:()=>o,ready:(j={})=>{if(u)return Promise.resolve();const O=j.timeoutMs??1e4;return new Promise((D,L)=>{const q={resolve:D,reject:L,timer:null};q.timer=m(()=>{g.delete(q),L(new Error("tunnel: channel ready timed out"))},O),g.add(q)})},dispose:()=>{f=!1,p=!1,S(),l?.close(),l=null,A.resetAll("disposed"),k("disposed")}}}const cM=t=>{const a=t.onStatus??(()=>{});return async({daemonId:o,deviceId:i,stored:l})=>{let u;try{u=await t.resolveSession({daemonId:o,deviceId:i,stored:l})}catch(p){return p.relayTokenStatus===403?{ok:!1,failure:{code:"relay_revoked",message:`device session revoked for ${o}`}}:{ok:!1,failure:{code:"select_failed",message:`could not establish a session for ${o}: ${p.message}`}}}const f=lM({session:u,onStatus:a,...t.WebSocketImpl?{WebSocketImpl:t.WebSocketImpl}:{}});try{await f.ready({timeoutMs:t.readyTimeoutMs??1e4})}catch(p){return f.dispose(),{ok:!1,failure:{code:"select_failed",message:`could not open a ready tunnel for ${o}: ${p.message}`}}}return WT(f),{ok:!0}}},uM=(t={})=>{if(!(t.isGateway??x1)())return{mode:"direct"};if(!t.resolveSession)throw new Error("bootTransport: a gateway bundle requires resolveSession to build the tunnel");return{mode:"tunnel",connectTransport:cM({resolveSession:t.resolveSession,...t.onStatus?{onStatus:t.onStatus}:{},...t.WebSocketImpl?{WebSocketImpl:t.WebSocketImpl}:{},...t.readyTimeoutMs!==void 0?{readyTimeoutMs:t.readyTimeoutMs}:{}})}},dM=async({stored:t})=>{if(!t)throw new Error("mobileResolveSession: no persisted device session for the selected daemon");const a=window.location.origin,o=a.replace(/^http/,"ws"),i=await fetch(`${a}/pair/relay-token`,{method:"POST",credentials:"include"});if(!i.ok)throw Object.assign(new Error(`mobileResolveSession: relay-token request failed (${i.status})`),{relayTokenStatus:i.status});const{token:l}=await i.json();return{roots:{d2p:ri(t.rootKeys.d2p),p2d:ri(t.rootKeys.p2d)},deviceId:t.deviceId,daemonId:t.daemonId,gatewayUrl:o,phoneSessionToken:l}},j1=document.getElementById("root");if(!j1)throw new Error("Root element not found");const fM=uM({resolveSession:dM,onStatus:P3});tS.createRoot(j1).render(c.jsx(y.StrictMode,{children:MD(fM,d5,DD)}));x3();export{yc as $,gc as A,AM as B,_o as C,jM as D,li as E,kM as F,CM as G,a0 as H,Jb as I,ci as J,TM as K,Va as L,fE as M,_M as N,Mo as O,Do as P,Tm as Q,Oo as R,RE as S,et as T,ZS as U,NM as V,s0 as W,Ga as X,SM as Y,EM as Z,Pa as _,OM as a,oi as a0,SA as a1,bM as a2,wM as a3,rN as a4,xM as a5,$s as a6,ow as a7,Cm as a8,WM as a9,e0 as aa,Zb as ab,Xl as ac,WS as ad,IM as ae,t0 as af,nR as ag,BM as ah,Nt as ai,Kw as aj,sx as ak,UM as al,I_ as am,Em as an,vM as ao,yM as ap,TS as aq,vc as b,ye as c,Xb as d,tn as e,MM as f,hM as g,DE as h,xt as i,c as j,Lo as k,RM as l,zo as m,BS as n,LM as o,zM as p,Ao as q,y as r,gM as s,bc as t,Se as u,HM as v,DM as w,Ja as x,Nr as y,pM as z};
|