@tt-a1i/hive 2.1.5 → 2.1.6
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 +15 -0
- package/dist/src/server/agent-startup-instructions.d.ts +1 -0
- package/dist/src/server/agent-startup-instructions.js +2 -1
- package/dist/src/server/hive-team-guidance.js +2 -2
- package/package.json +1 -1
- package/web/dist/assets/{AddWorkerDialog-AxzWv2T8.js → AddWorkerDialog-DFNkbR_Q.js} +2 -2
- package/web/dist/assets/{AddWorkspaceFlow-D-Yh_kk_.js → AddWorkspaceFlow-BjpjCuRe.js} +1 -1
- package/web/dist/assets/{FirstRunWizard-nAK4Eprj.js → FirstRunWizard-BuLgUAny.js} +1 -1
- package/web/dist/assets/{MarketplaceDrawer-B8JW-znT.js → MarketplaceDrawer-BALuhrnd.js} +1 -1
- package/web/dist/assets/{TaskGraphDrawer-BQ9Wr41D.js → TaskGraphDrawer-DQTS6JPI.js} +1 -1
- package/web/dist/assets/{WhatsNewDialog-D7DwCnTR.js → WhatsNewDialog-DpgjEIaA.js} +1 -1
- package/web/dist/assets/{WorkerModal-tU-XkiFG.js → WorkerModal-1y-Xdwv-.js} +1 -1
- package/web/dist/assets/{WorkflowsDrawer-DCa-HN3D.js → WorkflowsDrawer-DPWlZs4S.js} +1 -1
- package/web/dist/assets/{WorkspaceMemoryDrawer-4hLlu8BO.js → WorkspaceMemoryDrawer-C0vny4zK.js} +1 -1
- package/web/dist/assets/{WorkspaceTaskDrawer-D3LcLkw_.js → WorkspaceTaskDrawer-CJcFZh8C.js} +1 -1
- package/web/dist/assets/index-CEP_bvOg.css +1 -0
- package/web/dist/assets/index-CR1SPGBZ.js +84 -0
- package/web/dist/assets/{search-CcRvD2Q5.js → search-Bl5O-SfR.js} +1 -1
- package/web/dist/assets/{square-terminal-zBgH6nhI.js → square-terminal-DCDaflg3.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/dist/sw.js +1 -1
- package/web/dist/assets/index-B8tv0NRK.js +0 -84
- package/web/dist/assets/index-CG2TurwT.css +0 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WorkspaceTaskDrawer-CJcFZh8C.js","assets/TaskGraphDrawer-DQTS6JPI.js","assets/AddWorkerDialog-DFNkbR_Q.js","assets/search-Bl5O-SfR.js","assets/square-terminal-DCDaflg3.js","assets/WorkflowsDrawer-DPWlZs4S.js","assets/WorkspaceMemoryDrawer-C0vny4zK.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
function L2(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 Bb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Kd={exports:{}},_s={};var Gv;function z2(){if(Gv)return _s;Gv=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 m in l)m!=="key"&&(u[m]=l[m])}else u=l;return l=u.ref,{$$typeof:t,type:i,key:f,ref:l!==void 0?l:null,props:u}}return _s.Fragment=a,_s.jsx=o,_s.jsxs=o,_s}var Xv;function H2(){return Xv||(Xv=1,Kd.exports=z2()),Kd.exports}var c=H2(),Yd={exports:{}},je={};var Zv;function B2(){if(Zv)return je;Zv=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"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=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 T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,E={};function C(R,B,re){this.props=R,this.context=B,this.refs=E,this.updater=re||T}C.prototype.isReactComponent={},C.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")},C.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function j(){}j.prototype=C.prototype;function _(R,B,re){this.props=R,this.context=B,this.refs=E,this.updater=re||T}var N=_.prototype=new j;N.constructor=_,w(N,C.prototype),N.isPureReactComponent=!0;var O=Array.isArray;function M(){}var L={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function q(R,B,re){var ne=re.ref;return{$$typeof:t,type:R,key:B,ref:ne!==void 0?ne:null,props:re}}function ae(R,B){return q(R.type,B,R.props)}function ee(R){return typeof R=="object"&&R!==null&&R.$$typeof===t}function F(R){var B={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(re){return B[re]})}var J=/\/+/g;function X(R,B){return typeof R=="object"&&R!==null&&R.key!=null?F(""+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(M,M):(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 D(R,B,re,ne,de){var fe=typeof R;(fe==="undefined"||fe==="boolean")&&(R=null);var ue=!1;if(R===null)ue=!0;else switch(fe){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(R.$$typeof){case t:case a:ue=!0;break;case y:return ue=R._init,D(ue(R._payload),B,re,ne,de)}}if(ue)return de=de(R),ue=ne===""?"."+X(R,0):ne,O(de)?(re="",ue!=null&&(re=ue.replace(J,"$&/")+"/"),D(de,B,re,"",function(ce){return ce})):de!=null&&(ee(de)&&(de=ae(de,re+(de.key==null||R&&R.key===de.key?"":(""+de.key).replace(J,"$&/")+"/")+ue)),B.push(de)),1;ue=0;var ie=ne===""?".":ne+":";if(O(R))for(var le=0;le<R.length;le++)ne=R[le],fe=ie+X(ne,le),ue+=D(ne,B,re,fe,de);else if(le=S(R),typeof le=="function")for(R=le.call(R),le=0;!(ne=R.next()).done;)ne=ne.value,fe=ie+X(ne,le++),ue+=D(ne,B,re,fe,de);else if(fe==="object"){if(typeof R.then=="function")return D(V(R),B,re,ne,de);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,re){if(R==null)return R;var ne=[],de=0;return D(R,ne,"","",function(fe){return B.call(re,fe,de++)}),ne}function I(R){if(R._status===-1){var B=R._result;B=B(),B.then(function(re){(R._status===0||R._status===-1)&&(R._status=1,R._result=re)},function(re){(R._status===0||R._status===-1)&&(R._status=2,R._result=re)}),R._status===-1&&(R._status=0,R._result=B)}if(R._status===1)return R._result.default;throw R._result}var $=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)},Z={map:P,forEach:function(R,B,re){P(R,function(){B.apply(this,arguments)},re)},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(!ee(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return je.Activity=v,je.Children=Z,je.Component=C,je.Fragment=o,je.Profiler=l,je.PureComponent=_,je.StrictMode=i,je.Suspense=g,je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,je.__COMPILER_RUNTIME={__proto__:null,c:function(R){return L.H.useMemoCache(R)}},je.cache=function(R){return function(){return R.apply(null,arguments)}},je.cacheSignal=function(){return null},je.cloneElement=function(R,B,re){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var ne=w({},R.props),de=R.key;if(B!=null)for(fe in B.key!==void 0&&(de=""+B.key),B)!U.call(B,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&B.ref===void 0||(ne[fe]=B[fe]);var fe=arguments.length-2;if(fe===1)ne.children=re;else if(1<fe){for(var ue=Array(fe),ie=0;ie<fe;ie++)ue[ie]=arguments[ie+2];ne.children=ue}return q(R.type,de,ne)},je.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},je.createElement=function(R,B,re){var ne,de={},fe=null;if(B!=null)for(ne in B.key!==void 0&&(fe=""+B.key),B)U.call(B,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(de[ne]=B[ne]);var ue=arguments.length-2;if(ue===1)de.children=re;else if(1<ue){for(var ie=Array(ue),le=0;le<ue;le++)ie[le]=arguments[le+2];de.children=ie}if(R&&R.defaultProps)for(ne in ue=R.defaultProps,ue)de[ne]===void 0&&(de[ne]=ue[ne]);return q(R,fe,de)},je.createRef=function(){return{current:null}},je.forwardRef=function(R){return{$$typeof:m,render:R}},je.isValidElement=ee,je.lazy=function(R){return{$$typeof:y,_payload:{_status:-1,_result:R},_init:I}},je.memo=function(R,B){return{$$typeof:p,type:R,compare:B===void 0?null:B}},je.startTransition=function(R){var B=L.T,re={};L.T=re;try{var ne=R(),de=L.S;de!==null&&de(re,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(M,$)}catch(fe){$(fe)}finally{B!==null&&re.types!==null&&(B.types=re.types),L.T=B}},je.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},je.use=function(R){return L.H.use(R)},je.useActionState=function(R,B,re){return L.H.useActionState(R,B,re)},je.useCallback=function(R,B){return L.H.useCallback(R,B)},je.useContext=function(R){return L.H.useContext(R)},je.useDebugValue=function(){},je.useDeferredValue=function(R,B){return L.H.useDeferredValue(R,B)},je.useEffect=function(R,B){return L.H.useEffect(R,B)},je.useEffectEvent=function(R){return L.H.useEffectEvent(R)},je.useId=function(){return L.H.useId()},je.useImperativeHandle=function(R,B,re){return L.H.useImperativeHandle(R,B,re)},je.useInsertionEffect=function(R,B){return L.H.useInsertionEffect(R,B)},je.useLayoutEffect=function(R,B){return L.H.useLayoutEffect(R,B)},je.useMemo=function(R,B){return L.H.useMemo(R,B)},je.useOptimistic=function(R,B){return L.H.useOptimistic(R,B)},je.useReducer=function(R,B,re){return L.H.useReducer(R,B,re)},je.useRef=function(R){return L.H.useRef(R)},je.useState=function(R){return L.H.useState(R)},je.useSyncExternalStore=function(R,B,re){return L.H.useSyncExternalStore(R,B,re)},je.useTransition=function(){return L.H.useTransition()},je.version="19.2.5",je}var Qv;function ym(){return Qv||(Qv=1,Yd.exports=B2()),Yd.exports}var b=ym();const U2=Bb(b),Ub=L2({__proto__:null,default:U2},[b]);var Vd={exports:{}},Rs={},$d={exports:{}},Gd={};var Jv;function W2(){return Jv||(Jv=1,(function(t){function a(D,P){var I=D.length;D.push(P);e:for(;0<I;){var $=I-1>>>1,Z=D[$];if(0<l(Z,P))D[$]=P,D[I]=Z,I=$;else break e}}function o(D){return D.length===0?null:D[0]}function i(D){if(D.length===0)return null;var P=D[0],I=D.pop();if(I!==P){D[0]=I;e:for(var $=0,Z=D.length,R=Z>>>1;$<R;){var B=2*($+1)-1,re=D[B],ne=B+1,de=D[ne];if(0>l(re,I))ne<Z&&0>l(de,re)?(D[$]=de,D[ne]=I,$=ne):(D[$]=re,D[B]=I,$=B);else if(ne<Z&&0>l(de,I))D[$]=de,D[ne]=I,$=ne;else break e}}return P}function l(D,P){var I=D.sortIndex-P.sortIndex;return I!==0?I:D.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,m=f.now();t.unstable_now=function(){return f.now()-m}}var g=[],p=[],y=1,v=null,k=3,S=!1,T=!1,w=!1,E=!1,C=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function N(D){for(var P=o(p);P!==null;){if(P.callback===null)i(p);else if(P.startTime<=D)i(p),P.sortIndex=P.expirationTime,a(g,P);else break;P=o(p)}}function O(D){if(w=!1,N(D),!T)if(o(g)!==null)T=!0,M||(M=!0,F());else{var P=o(p);P!==null&&V(O,P.startTime-D)}}var M=!1,L=-1,U=5,q=-1;function ae(){return E?!0:!(t.unstable_now()-q<U)}function ee(){if(E=!1,M){var D=t.unstable_now();q=D;var P=!0;try{e:{T=!1,w&&(w=!1,j(L),L=-1),S=!0;var I=k;try{t:{for(N(D),v=o(g);v!==null&&!(v.expirationTime>D&&ae());){var $=v.callback;if(typeof $=="function"){v.callback=null,k=v.priorityLevel;var Z=$(v.expirationTime<=D);if(D=t.unstable_now(),typeof Z=="function"){v.callback=Z,N(D),P=!0;break t}v===o(g)&&i(g),N(D)}else i(g);v=o(g)}if(v!==null)P=!0;else{var R=o(p);R!==null&&V(O,R.startTime-D),P=!1}}break e}finally{v=null,k=I,S=!1}P=void 0}}finally{P?F():M=!1}}}var F;if(typeof _=="function")F=function(){_(ee)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,X=J.port2;J.port1.onmessage=ee,F=function(){X.postMessage(null)}}else F=function(){C(ee,0)};function V(D,P){L=C(function(){D(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(D){D.callback=null},t.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<D?Math.floor(1e3/D):5},t.unstable_getCurrentPriorityLevel=function(){return k},t.unstable_next=function(D){switch(k){case 1:case 2:case 3:var P=3;break;default:P=k}var I=k;k=P;try{return D()}finally{k=I}},t.unstable_requestPaint=function(){E=!0},t.unstable_runWithPriority=function(D,P){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var I=k;k=D;try{return P()}finally{k=I}},t.unstable_scheduleCallback=function(D,P,I){var $=t.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?$+I:$):I=$,D){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=I+Z,D={id:y++,callback:P,priorityLevel:D,startTime:I,expirationTime:Z,sortIndex:-1},I>$?(D.sortIndex=I,a(p,D),o(g)===null&&D===o(p)&&(w?(j(L),L=-1):w=!0,V(O,I-$))):(D.sortIndex=Z,a(g,D),T||S||(T=!0,M||(M=!0,F()))),D},t.unstable_shouldYield=ae,t.unstable_wrapCallback=function(D){var P=k;return function(){var I=k;k=P;try{return D.apply(this,arguments)}finally{k=I}}}})(Gd)),Gd}var ey;function I2(){return ey||(ey=1,$d.exports=W2()),$d.exports}var Xd={exports:{}},kt={};var ty;function q2(){if(ty)return kt;ty=1;var t=ym();function a(g){var p="https://react.dev/errors/"+g;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)p+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+p+" 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,p,y){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:v==null?null:""+v,children:g,containerInfo:p,implementation:y}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,p){if(g==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return kt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,kt.createPortal=function(g,p){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(a(299));return u(g,p,null,y)},kt.flushSync=function(g){var p=f.T,y=i.p;try{if(f.T=null,i.p=2,g)return g()}finally{f.T=p,i.p=y,i.d.f()}},kt.preconnect=function(g,p){typeof g=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,i.d.C(g,p))},kt.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},kt.preinit=function(g,p){if(typeof g=="string"&&p&&typeof p.as=="string"){var y=p.as,v=m(y,p.crossOrigin),k=typeof p.integrity=="string"?p.integrity:void 0,S=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;y==="style"?i.d.S(g,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:v,integrity:k,fetchPriority:S}):y==="script"&&i.d.X(g,{crossOrigin:v,integrity:k,fetchPriority:S,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},kt.preinitModule=function(g,p){if(typeof g=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var y=m(p.as,p.crossOrigin);i.d.M(g,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&i.d.M(g)},kt.preload=function(g,p){if(typeof g=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var y=p.as,v=m(y,p.crossOrigin);i.d.L(g,y,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},kt.preloadModule=function(g,p){if(typeof g=="string")if(p){var y=m(p.as,p.crossOrigin);i.d.m(g,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else i.d.m(g)},kt.requestFormReset=function(g){i.d.r(g)},kt.unstable_batchedUpdates=function(g,p){return g(p)},kt.useFormState=function(g,p,y){return f.H.useFormState(g,p,y)},kt.useFormStatus=function(){return f.H.useHostTransitionStatus()},kt.version="19.2.5",kt}var ny;function Wb(){if(ny)return Xd.exports;ny=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(),Xd.exports=q2(),Xd.exports}var ay;function P2(){if(ay)return Rs;ay=1;var t=I2(),a=ym(),o=Wb();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 m(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 p(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,A=d.child;A;){if(A===r){x=!0,r=d,s=h;break}if(A===s){x=!0,s=d,r=h;break}A=A.sibling}if(!x){for(A=h.child;A;){if(A===r){x=!0,r=h,s=d;break}if(A===s){x=!0,s=h,r=d;break}A=A.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 y(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=y(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"),T=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),_=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),ae=Symbol.for("react.memo_cache_sentinel"),ee=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=ee&&e[ee]||e["@@iterator"],typeof e=="function"?e:null)}var J=Symbol.for("react.client.reference");function X(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===J?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case C:return"Profiler";case E:return"StrictMode";case O:return"Suspense";case M:return"SuspenseList";case q:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case _:return e.displayName||"Context";case j:return(e._context.displayName||"Context")+".Consumer";case N: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:X(e.type)||"Memo";case U:n=e._payload,e=e._init;try{return X(e(n))}catch{}}return null}var V=Array.isArray,D=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=-1;function R(e){return{current:e}}function B(e){0>Z||(e.current=$[Z],$[Z]=null,Z--)}function re(e,n){Z++,$[Z]=e.current,e.current=n}var ne=R(null),de=R(null),fe=R(null),ue=R(null);function ie(e,n){switch(re(fe,n),re(de,e),re(ne,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?yv(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=yv(n),e=bv(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(ne),re(ne,e)}function le(){B(ne),B(de),B(fe)}function ce(e){e.memoizedState!==null&&re(ue,e);var n=ne.current,r=bv(n,e.type);n!==r&&(re(de,e),re(ne,r))}function me(e){de.current===e&&(B(ne),B(de)),ue.current===e&&(B(ue),Ts._currentValue=I)}var Te,Ne;function Se(e){if(Te===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);Te=n&&n[1]||"",Ne=-1<r.stack.indexOf(`
|
|
3
|
+
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
+
`+Te+e+Ne}var rt=!1;function xt(e,n){if(!e||rt)return"";rt=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(Q){var G=Q}Reflect.construct(e,[],se)}else{try{se.call()}catch(Q){G=Q}e.call(se.prototype)}}else{try{throw Error()}catch(Q){G=Q}(se=e())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(Q){if(Q&&G&&typeof Q.stack=="string")return[Q.stack,G.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],A=h[1];if(x&&A){var z=x.split(`
|
|
5
|
+
`),Y=A.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 te=`
|
|
7
|
+
`+z[s].replace(" at new "," at ");return e.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",e.displayName)),te}while(1<=s&&0<=d);break}}}finally{rt=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?Se(r):""}function Wt(e,n){switch(e.tag){case 26:case 27:case 5:return Se(e.type);case 16:return Se("Lazy");case 13:return e.child!==n&&n!==null?Se("Suspense Fallback"):Se("Suspense");case 19:return Se("SuspenseList");case 0:case 15:return xt(e.type,!1);case 11:return xt(e.type.render,!1);case 1:return xt(e.type,!0);case 31:return Se("Activity");default:return""}}function pn(e){try{var n="",r=null;do n+=Wt(e,r),r=e,e=e.return;while(e);return n}catch(s){return`
|
|
8
|
+
Error generating stack: `+s.message+`
|
|
9
|
+
`+s.stack}}var hn=Object.prototype.hasOwnProperty,Tn=t.unstable_scheduleCallback,tn=t.unstable_cancelCallback,ke=t.unstable_shouldYield,pe=t.unstable_requestPaint,Oe=t.unstable_now,Xa=t.unstable_getCurrentPriorityLevel,Ho=t.unstable_ImmediatePriority,Ee=t.unstable_UserBlockingPriority,Be=t.unstable_NormalPriority,ft=t.unstable_LowPriority,Za=t.unstable_IdlePriority,v1=t.log,y1=t.unstable_setDisableYieldValue,Bo=null,It=null;function ua(e){if(typeof v1=="function"&&y1(e),It&&typeof It.setStrictMode=="function")try{It.setStrictMode(Bo,e)}catch{}}var qt=Math.clz32?Math.clz32:x1,b1=Math.log,w1=Math.LN2;function x1(e){return e>>>=0,e===0?32:31-(b1(e)/w1|0)|0}var si=256,ii=262144,li=4194304;function Qa(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 ci(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 A=s&134217727;return A!==0?(s=A&~h,s!==0?d=Qa(s):(x&=A,x!==0?d=Qa(x):r||(r=A&~e,r!==0&&(d=Qa(r))))):(A=s&~h,A!==0?d=Qa(A):x!==0?d=Qa(x):r||(r=s&~e,r!==0&&(d=Qa(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 Uo(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function k1(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 Jm(){var e=li;return li<<=1,(li&62914560)===0&&(li=4194304),e}function Dc(e){for(var n=[],r=0;31>r;r++)n.push(e);return n}function Wo(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function S1(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 A=e.entanglements,z=e.expirationTimes,Y=e.hiddenUpdates;for(r=x&~r;0<r;){var te=31-qt(r),se=1<<te;A[te]=0,z[te]=-1;var G=Y[te];if(G!==null)for(Y[te]=null,te=0;te<G.length;te++){var Q=G[te];Q!==null&&(Q.lane&=-536870913)}r&=~se}s!==0&&ep(e,s,0),h!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=h&~(x&~n))}function ep(e,n,r){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-qt(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|r&261930}function tp(e,n){var r=e.entangledLanes|=n;for(e=e.entanglements;r;){var s=31-qt(r),d=1<<s;d&n|e[s]&n&&(e[s]|=n),r&=~d}}function np(e,n){var r=n&-n;return r=(r&42)!==0?1:Mc(r),(r&(e.suspendedLanes|n))!==0?0:r}function Mc(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 Lc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ap(){var e=P.p;return e!==0?e:(e=window.event,e===void 0?32:qv(e.type))}function rp(e,n){var r=P.p;try{return P.p=e,n()}finally{P.p=r}}var da=Math.random().toString(36).slice(2),mt="__reactFiber$"+da,jt="__reactProps$"+da,Tr="__reactContainer$"+da,zc="__reactEvents$"+da,E1="__reactListeners$"+da,C1="__reactHandles$"+da,op="__reactResources$"+da,Io="__reactMarker$"+da;function Hc(e){delete e[mt],delete e[jt],delete e[zc],delete e[E1],delete e[C1]}function Nr(e){var n=e[mt];if(n)return n;for(var r=e.parentNode;r;){if(n=r[Tr]||r[mt]){if(r=n.alternate,n.child!==null||r!==null&&r.child!==null)for(e=Tv(e);e!==null;){if(r=e[mt])return r;e=Tv(e)}return n}e=r,r=e.parentNode}return null}function jr(e){if(e=e[mt]||e[Tr]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function qo(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(i(33))}function Ar(e){var n=e[op];return n||(n=e[op]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function ut(e){e[Io]=!0}var sp=new Set,ip={};function Ja(e,n){_r(e,n),_r(e+"Capture",n)}function _r(e,n){for(ip[e]=n,e=0;e<n.length;e++)sp.add(n[e])}var T1=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]*$"),lp={},cp={};function N1(e){return hn.call(cp,e)?!0:hn.call(lp,e)?!1:T1.test(e)?cp[e]=!0:(lp[e]=!0,!1)}function ui(e,n,r){if(N1(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 di(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 Wn(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 nn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function up(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function j1(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 Bc(e){if(!e._valueTracker){var n=up(e)?"checked":"value";e._valueTracker=j1(e,n,""+e[n])}}function dp(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var r=n.getValue(),s="";return e&&(s=up(e)?e.checked?"true":"false":e.value),e=s,e!==r?(n.setValue(e),!0):!1}function fi(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 A1=/[\n"\\]/g;function an(e){return e.replace(A1,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Uc(e,n,r,s,d,h,x,A){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=""+nn(n)):e.value!==""+nn(n)&&(e.value=""+nn(n)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),n!=null?Wc(e,x,nn(n)):r!=null?Wc(e,x,nn(r)):s!=null&&e.removeAttribute("value"),d==null&&h!=null&&(e.defaultChecked=!!h),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?e.name=""+nn(A):e.removeAttribute("name")}function fp(e,n,r,s,d,h,x,A){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)){Bc(e);return}r=r!=null?""+nn(r):"",n=n!=null?""+nn(n):r,A||n===e.value||(e.value=n),e.defaultValue=n}s=s??d,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=A?e.checked:!!s,e.defaultChecked=!!s,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Bc(e)}function Wc(e,n,r){n==="number"&&fi(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function Rr(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=""+nn(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 mp(e,n,r){if(n!=null&&(n=""+nn(n),n!==e.value&&(e.value=n),r==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=r!=null?""+nn(r):""}function pp(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=nn(n),e.defaultValue=r,s=e.textContent,s===r&&s!==""&&s!==null&&(e.value=s),Bc(e)}function Or(e,n){if(n){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=n;return}}e.textContent=n}var _1=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 hp(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||_1.has(n)?n==="float"?e.cssFloat=r:e[n]=(""+r).trim():e[n]=r+"px"}function gp(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&&hp(e,d,s)}else for(var h in n)n.hasOwnProperty(h)&&hp(e,h,n[h])}function Ic(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 R1=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"]]),O1=/^[\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 mi(e){return O1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function In(){}var qc=null;function Pc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Dr=null,Mr=null;function vp(e){var n=jr(e);if(n&&(e=n.stateNode)){var r=e[jt]||null;e:switch(e=n.stateNode,n.type){case"input":if(Uc(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="'+an(""+n)+'"][type="radio"]'),n=0;n<r.length;n++){var s=r[n];if(s!==e&&s.form===e.form){var d=s[jt]||null;if(!d)throw Error(i(90));Uc(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&&dp(s)}break e;case"textarea":mp(e,r.value,r.defaultValue);break e;case"select":n=r.value,n!=null&&Rr(e,!!r.multiple,n,!1)}}}var Fc=!1;function yp(e,n,r){if(Fc)return e(n,r);Fc=!0;try{var s=e(n);return s}finally{if(Fc=!1,(Dr!==null||Mr!==null)&&(el(),Dr&&(n=Dr,e=Mr,Mr=Dr=null,vp(n),e)))for(n=0;n<e.length;n++)vp(e[n])}}function Po(e,n){var r=e.stateNode;if(r===null)return null;var s=r[jt]||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 qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Kc=!1;if(qn)try{var Fo={};Object.defineProperty(Fo,"passive",{get:function(){Kc=!0}}),window.addEventListener("test",Fo,Fo),window.removeEventListener("test",Fo,Fo)}catch{Kc=!1}var fa=null,Yc=null,pi=null;function bp(){if(pi)return pi;var e,n=Yc,r=n.length,s,d="value"in fa?fa.value:fa.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 pi=d.slice(e,1<s?1-s:void 0)}function hi(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 gi(){return!0}function wp(){return!1}function At(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 A in e)e.hasOwnProperty(A)&&(r=e[A],this[A]=r?r(h):h[A]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?gi:wp,this.isPropagationStopped=wp,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=gi)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=gi)},persist:function(){},isPersistent:gi}),n}var er={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vi=At(er),Ko=v({},er,{view:0,detail:0}),D1=At(Ko),Vc,$c,Yo,yi=v({},Ko,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xc,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!==Yo&&(Yo&&e.type==="mousemove"?(Vc=e.screenX-Yo.screenX,$c=e.screenY-Yo.screenY):$c=Vc=0,Yo=e),Vc)},movementY:function(e){return"movementY"in e?e.movementY:$c}}),xp=At(yi),M1=v({},yi,{dataTransfer:0}),L1=At(M1),z1=v({},Ko,{relatedTarget:0}),Gc=At(z1),H1=v({},er,{animationName:0,elapsedTime:0,pseudoElement:0}),B1=At(H1),U1=v({},er,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),W1=At(U1),I1=v({},er,{data:0}),kp=At(I1),q1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},P1={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"},F1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function K1(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=F1[e])?!!n[e]:!1}function Xc(){return K1}var Y1=v({},Ko,{key:function(e){if(e.key){var n=q1[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=hi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?P1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xc,charCode:function(e){return e.type==="keypress"?hi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?hi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),V1=At(Y1),$1=v({},yi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sp=At($1),G1=v({},Ko,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xc}),X1=At(G1),Z1=v({},er,{propertyName:0,elapsedTime:0,pseudoElement:0}),Q1=At(Z1),J1=v({},yi,{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}),ek=At(J1),tk=v({},er,{newState:0,oldState:0}),nk=At(tk),ak=[9,13,27,32],Zc=qn&&"CompositionEvent"in window,Vo=null;qn&&"documentMode"in document&&(Vo=document.documentMode);var rk=qn&&"TextEvent"in window&&!Vo,Ep=qn&&(!Zc||Vo&&8<Vo&&11>=Vo),Cp=" ",Tp=!1;function Np(e,n){switch(e){case"keyup":return ak.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Lr=!1;function ok(e,n){switch(e){case"compositionend":return jp(n);case"keypress":return n.which!==32?null:(Tp=!0,Cp);case"textInput":return e=n.data,e===Cp&&Tp?null:e;default:return null}}function sk(e,n){if(Lr)return e==="compositionend"||!Zc&&Np(e,n)?(e=bp(),pi=Yc=fa=null,Lr=!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 Ep&&n.locale!=="ko"?null:n.data;default:return null}}var ik={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 Ap(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!ik[e.type]:n==="textarea"}function _p(e,n,r,s){Dr?Mr?Mr.push(s):Mr=[s]:Dr=s,n=il(n,"onChange"),0<n.length&&(r=new vi("onChange","change",null,r,s),e.push({event:r,listeners:n}))}var $o=null,Go=null;function lk(e){fv(e,0)}function bi(e){var n=qo(e);if(dp(n))return e}function Rp(e,n){if(e==="change")return n}var Op=!1;if(qn){var Qc;if(qn){var Jc="oninput"in document;if(!Jc){var Dp=document.createElement("div");Dp.setAttribute("oninput","return;"),Jc=typeof Dp.oninput=="function"}Qc=Jc}else Qc=!1;Op=Qc&&(!document.documentMode||9<document.documentMode)}function Mp(){$o&&($o.detachEvent("onpropertychange",Lp),Go=$o=null)}function Lp(e){if(e.propertyName==="value"&&bi(Go)){var n=[];_p(n,Go,e,Pc(e)),yp(lk,n)}}function ck(e,n,r){e==="focusin"?(Mp(),$o=n,Go=r,$o.attachEvent("onpropertychange",Lp)):e==="focusout"&&Mp()}function uk(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return bi(Go)}function dk(e,n){if(e==="click")return bi(n)}function fk(e,n){if(e==="input"||e==="change")return bi(n)}function mk(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Pt=typeof Object.is=="function"?Object.is:mk;function Xo(e,n){if(Pt(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(!hn.call(n,d)||!Pt(e[d],n[d]))return!1}return!0}function zp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Hp(e,n){var r=zp(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=zp(r)}}function Bp(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Bp(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Up(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=fi(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=fi(e.document)}return n}function eu(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 pk=qn&&"documentMode"in document&&11>=document.documentMode,zr=null,tu=null,Zo=null,nu=!1;function Wp(e,n,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;nu||zr==null||zr!==fi(s)||(s=zr,"selectionStart"in s&&eu(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}),Zo&&Xo(Zo,s)||(Zo=s,s=il(tu,"onSelect"),0<s.length&&(n=new vi("onSelect","select",null,n,r),e.push({event:n,listeners:s}),n.target=zr)))}function tr(e,n){var r={};return r[e.toLowerCase()]=n.toLowerCase(),r["Webkit"+e]="webkit"+n,r["Moz"+e]="moz"+n,r}var Hr={animationend:tr("Animation","AnimationEnd"),animationiteration:tr("Animation","AnimationIteration"),animationstart:tr("Animation","AnimationStart"),transitionrun:tr("Transition","TransitionRun"),transitionstart:tr("Transition","TransitionStart"),transitioncancel:tr("Transition","TransitionCancel"),transitionend:tr("Transition","TransitionEnd")},au={},Ip={};qn&&(Ip=document.createElement("div").style,"AnimationEvent"in window||(delete Hr.animationend.animation,delete Hr.animationiteration.animation,delete Hr.animationstart.animation),"TransitionEvent"in window||delete Hr.transitionend.transition);function nr(e){if(au[e])return au[e];if(!Hr[e])return e;var n=Hr[e],r;for(r in n)if(n.hasOwnProperty(r)&&r in Ip)return au[e]=n[r];return e}var qp=nr("animationend"),Pp=nr("animationiteration"),Fp=nr("animationstart"),hk=nr("transitionrun"),gk=nr("transitionstart"),vk=nr("transitioncancel"),Kp=nr("transitionend"),Yp=new Map,ru="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(" ");ru.push("scrollEnd");function gn(e,n){Yp.set(e,n),Ja(n,[e])}var wi=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)},rn=[],Br=0,ou=0;function xi(){for(var e=Br,n=ou=Br=0;n<e;){var r=rn[n];rn[n++]=null;var s=rn[n];rn[n++]=null;var d=rn[n];rn[n++]=null;var h=rn[n];if(rn[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&&Vp(r,d,h)}}function ki(e,n,r,s){rn[Br++]=e,rn[Br++]=n,rn[Br++]=r,rn[Br++]=s,ou|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function su(e,n,r,s){return ki(e,n,r,s),Si(e)}function ar(e,n){return ki(e,null,null,n),Si(e)}function Vp(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-qt(r),e=h.hiddenUpdates,s=e[d],s===null?e[d]=[n]:s.push(n),n.lane=r|536870912),h):null}function Si(e){if(50<bs)throw bs=0,hd=null,Error(i(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Ur={};function yk(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 Ft(e,n,r,s){return new yk(e,n,r,s)}function iu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Pn(e,n){var r=e.alternate;return r===null?(r=Ft(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 $p(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 Ei(e,n,r,s,d,h){var x=0;if(s=e,typeof e=="function")iu(e)&&(x=1);else if(typeof e=="string")x=S2(e,r,ne.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case q:return e=Ft(31,r,n,d),e.elementType=q,e.lanes=h,e;case w:return rr(r.children,d,h,n);case E:x=8,d|=24;break;case C:return e=Ft(12,r,n,d|2),e.elementType=C,e.lanes=h,e;case O:return e=Ft(13,r,n,d),e.elementType=O,e.lanes=h,e;case M:return e=Ft(19,r,n,d),e.elementType=M,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _:x=10;break e;case j:x=9;break e;case N:x=11;break e;case L:x=14;break e;case U:x=16,s=null;break e}x=29,r=Error(i(130,e===null?"null":typeof e,"")),s=null}return n=Ft(x,r,n,d),n.elementType=e,n.type=s,n.lanes=h,n}function rr(e,n,r,s){return e=Ft(7,e,s,n),e.lanes=r,e}function lu(e,n,r){return e=Ft(6,e,null,n),e.lanes=r,e}function Gp(e){var n=Ft(18,null,null,0);return n.stateNode=e,n}function cu(e,n,r){return n=Ft(4,e.children!==null?e.children:[],e.key,n),n.lanes=r,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Xp=new WeakMap;function on(e,n){if(typeof e=="object"&&e!==null){var r=Xp.get(e);return r!==void 0?r:(n={value:e,source:n,stack:pn(n)},Xp.set(e,n),n)}return{value:e,source:n,stack:pn(n)}}var Wr=[],Ir=0,Ci=null,Qo=0,sn=[],ln=0,ma=null,Nn=1,jn="";function Fn(e,n){Wr[Ir++]=Qo,Wr[Ir++]=Ci,Ci=e,Qo=n}function Zp(e,n,r){sn[ln++]=Nn,sn[ln++]=jn,sn[ln++]=ma,ma=e;var s=Nn;e=jn;var d=32-qt(s)-1;s&=~(1<<d),r+=1;var h=32-qt(n)+d;if(30<h){var x=d-d%5;h=(s&(1<<x)-1).toString(32),s>>=x,d-=x,Nn=1<<32-qt(n)+d|r<<d|s,jn=h+e}else Nn=1<<h|r<<d|s,jn=e}function uu(e){e.return!==null&&(Fn(e,1),Zp(e,1,0))}function du(e){for(;e===Ci;)Ci=Wr[--Ir],Wr[Ir]=null,Qo=Wr[--Ir],Wr[Ir]=null;for(;e===ma;)ma=sn[--ln],sn[ln]=null,jn=sn[--ln],sn[ln]=null,Nn=sn[--ln],sn[ln]=null}function Qp(e,n){sn[ln++]=Nn,sn[ln++]=jn,sn[ln++]=ma,Nn=n.id,jn=n.overflow,ma=e}var pt=null,Ge=null,He=!1,pa=null,cn=!1,fu=Error(i(519));function ha(e){var n=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Jo(on(n,e)),fu}function Jp(e){var n=e.stateNode,r=e.type,s=e.memoizedProps;switch(n[mt]=e,n[jt]=s,r){case"dialog":Me("cancel",n),Me("close",n);break;case"iframe":case"object":case"embed":Me("load",n);break;case"video":case"audio":for(r=0;r<xs.length;r++)Me(xs[r],n);break;case"source":Me("error",n);break;case"img":case"image":case"link":Me("error",n),Me("load",n);break;case"details":Me("toggle",n);break;case"input":Me("invalid",n),fp(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Me("invalid",n);break;case"textarea":Me("invalid",n),pp(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||gv(n.textContent,r)?(s.popover!=null&&(Me("beforetoggle",n),Me("toggle",n)),s.onScroll!=null&&Me("scroll",n),s.onScrollEnd!=null&&Me("scrollend",n),s.onClick!=null&&(n.onclick=In),n=!0):n=!1,n||ha(e,!0)}function eh(e){for(pt=e.return;pt;)switch(pt.tag){case 5:case 31:case 13:cn=!1;return;case 27:case 3:cn=!0;return;default:pt=pt.return}}function qr(e){if(e!==pt)return!1;if(!He)return eh(e),He=!0,!1;var n=e.tag,r;if((r=n!==3&&n!==27)&&((r=n===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||_d(e.type,e.memoizedProps)),r=!r),r&&Ge&&ha(e),eh(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ge=Cv(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ge=Cv(e)}else n===27?(n=Ge,Aa(e.type)?(e=Ld,Ld=null,Ge=e):Ge=n):Ge=pt?dn(e.stateNode.nextSibling):null;return!0}function or(){Ge=pt=null,He=!1}function mu(){var e=pa;return e!==null&&(Dt===null?Dt=e:Dt.push.apply(Dt,e),pa=null),e}function Jo(e){pa===null?pa=[e]:pa.push(e)}var pu=R(null),sr=null,Kn=null;function ga(e,n,r){re(pu,n._currentValue),n._currentValue=r}function Yn(e){e._currentValue=pu.current,B(pu)}function hu(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 gu(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 A=h;h=d;for(var z=0;z<n.length;z++)if(A.context===n[z]){h.lanes|=r,A=h.alternate,A!==null&&(A.lanes|=r),hu(h.return,r,e),s||(x=null);break e}h=A.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),hu(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 Pr(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 A=d.type;Pt(d.pendingProps.value,x.value)||(e!==null?e.push(A):e=[A])}}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(Ts):e=[Ts])}d=d.return}e!==null&&gu(n,e,r,s),n.flags|=262144}function Ti(e){for(e=e.firstContext;e!==null;){if(!Pt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ir(e){sr=e,Kn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ht(e){return th(sr,e)}function Ni(e,n){return sr===null&&ir(e),th(e,n)}function th(e,n){var r=n._currentValue;if(n={context:n,memoizedValue:r,next:null},Kn===null){if(e===null)throw Error(i(308));Kn=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Kn=Kn.next=n;return r}var bk=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()})}},wk=t.unstable_scheduleCallback,xk=t.unstable_NormalPriority,ot={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vu(){return{controller:new bk,data:new Map,refCount:0}}function es(e){e.refCount--,e.refCount===0&&wk(xk,function(){e.controller.abort()})}var ts=null,yu=0,Fr=0,Kr=null;function kk(e,n){if(ts===null){var r=ts=[];yu=0,Fr=xd(),Kr={status:"pending",value:void 0,then:function(s){r.push(s)}}}return yu++,n.then(nh,nh),n}function nh(){if(--yu===0&&ts!==null){Kr!==null&&(Kr.status="fulfilled");var e=ts;ts=null,Fr=0,Kr=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function Sk(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 ah=D.S;D.S=function(e,n){Wg=Oe(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&kk(e,n),ah!==null&&ah(e,n)};var lr=R(null);function bu(){var e=lr.current;return e!==null?e:Ve.pooledCache}function ji(e,n){n===null?re(lr,lr.current):re(lr,n.pool)}function rh(){var e=bu();return e===null?null:{parent:ot._currentValue,pool:e}}var Yr=Error(i(460)),wu=Error(i(474)),Ai=Error(i(542)),_i={then:function(){}};function oh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function sh(e,n,r){switch(r=e[r],r===void 0?e.push(n):r!==n&&(n.then(In,In),n=r),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,lh(e),e;default:if(typeof n.status=="string")n.then(In,In);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,lh(e),e}throw ur=n,Yr}}function cr(e){try{var n=e._init;return n(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(ur=r,Yr):r}}var ur=null;function ih(){if(ur===null)throw Error(i(459));var e=ur;return ur=null,e}function lh(e){if(e===Yr||e===Ai)throw Error(i(483))}var Vr=null,ns=0;function Ri(e){var n=ns;return ns+=1,Vr===null&&(Vr=[]),sh(Vr,e,n)}function as(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Oi(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 ch(e){function n(W,H){if(e){var K=W.deletions;K===null?(W.deletions=[H],W.flags|=16):K.push(H)}}function r(W,H){if(!e)return null;for(;H!==null;)n(W,H),H=H.sibling;return null}function s(W){for(var H=new Map;W!==null;)W.key!==null?H.set(W.key,W):H.set(W.index,W),W=W.sibling;return H}function d(W,H){return W=Pn(W,H),W.index=0,W.sibling=null,W}function h(W,H,K){return W.index=K,e?(K=W.alternate,K!==null?(K=K.index,K<H?(W.flags|=67108866,H):K):(W.flags|=67108866,H)):(W.flags|=1048576,H)}function x(W){return e&&W.alternate===null&&(W.flags|=67108866),W}function A(W,H,K,oe){return H===null||H.tag!==6?(H=lu(K,W.mode,oe),H.return=W,H):(H=d(H,K),H.return=W,H)}function z(W,H,K,oe){var xe=K.type;return xe===w?te(W,H,K.props.children,oe,K.key):H!==null&&(H.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===U&&cr(xe)===H.type)?(H=d(H,K.props),as(H,K),H.return=W,H):(H=Ei(K.type,K.key,K.props,null,W.mode,oe),as(H,K),H.return=W,H)}function Y(W,H,K,oe){return H===null||H.tag!==4||H.stateNode.containerInfo!==K.containerInfo||H.stateNode.implementation!==K.implementation?(H=cu(K,W.mode,oe),H.return=W,H):(H=d(H,K.children||[]),H.return=W,H)}function te(W,H,K,oe,xe){return H===null||H.tag!==7?(H=rr(K,W.mode,oe,xe),H.return=W,H):(H=d(H,K),H.return=W,H)}function se(W,H,K){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=lu(""+H,W.mode,K),H.return=W,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case S:return K=Ei(H.type,H.key,H.props,null,W.mode,K),as(K,H),K.return=W,K;case T:return H=cu(H,W.mode,K),H.return=W,H;case U:return H=cr(H),se(W,H,K)}if(V(H)||F(H))return H=rr(H,W.mode,K,null),H.return=W,H;if(typeof H.then=="function")return se(W,Ri(H),K);if(H.$$typeof===_)return se(W,Ni(W,H),K);Oi(W,H)}return null}function G(W,H,K,oe){var xe=H!==null?H.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return xe!==null?null:A(W,H,""+K,oe);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case S:return K.key===xe?z(W,H,K,oe):null;case T:return K.key===xe?Y(W,H,K,oe):null;case U:return K=cr(K),G(W,H,K,oe)}if(V(K)||F(K))return xe!==null?null:te(W,H,K,oe,null);if(typeof K.then=="function")return G(W,H,Ri(K),oe);if(K.$$typeof===_)return G(W,H,Ni(W,K),oe);Oi(W,K)}return null}function Q(W,H,K,oe,xe){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return W=W.get(K)||null,A(H,W,""+oe,xe);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case S:return W=W.get(oe.key===null?K:oe.key)||null,z(H,W,oe,xe);case T:return W=W.get(oe.key===null?K:oe.key)||null,Y(H,W,oe,xe);case U:return oe=cr(oe),Q(W,H,K,oe,xe)}if(V(oe)||F(oe))return W=W.get(K)||null,te(H,W,oe,xe,null);if(typeof oe.then=="function")return Q(W,H,K,Ri(oe),xe);if(oe.$$typeof===_)return Q(W,H,K,Ni(H,oe),xe);Oi(H,oe)}return null}function he(W,H,K,oe){for(var xe=null,Ue=null,be=H,Re=H=0,ze=null;be!==null&&Re<K.length;Re++){be.index>Re?(ze=be,be=null):ze=be.sibling;var We=G(W,be,K[Re],oe);if(We===null){be===null&&(be=ze);break}e&&be&&We.alternate===null&&n(W,be),H=h(We,H,Re),Ue===null?xe=We:Ue.sibling=We,Ue=We,be=ze}if(Re===K.length)return r(W,be),He&&Fn(W,Re),xe;if(be===null){for(;Re<K.length;Re++)be=se(W,K[Re],oe),be!==null&&(H=h(be,H,Re),Ue===null?xe=be:Ue.sibling=be,Ue=be);return He&&Fn(W,Re),xe}for(be=s(be);Re<K.length;Re++)ze=Q(be,W,Re,K[Re],oe),ze!==null&&(e&&ze.alternate!==null&&be.delete(ze.key===null?Re:ze.key),H=h(ze,H,Re),Ue===null?xe=ze:Ue.sibling=ze,Ue=ze);return e&&be.forEach(function(Ma){return n(W,Ma)}),He&&Fn(W,Re),xe}function Ce(W,H,K,oe){if(K==null)throw Error(i(151));for(var xe=null,Ue=null,be=H,Re=H=0,ze=null,We=K.next();be!==null&&!We.done;Re++,We=K.next()){be.index>Re?(ze=be,be=null):ze=be.sibling;var Ma=G(W,be,We.value,oe);if(Ma===null){be===null&&(be=ze);break}e&&be&&Ma.alternate===null&&n(W,be),H=h(Ma,H,Re),Ue===null?xe=Ma:Ue.sibling=Ma,Ue=Ma,be=ze}if(We.done)return r(W,be),He&&Fn(W,Re),xe;if(be===null){for(;!We.done;Re++,We=K.next())We=se(W,We.value,oe),We!==null&&(H=h(We,H,Re),Ue===null?xe=We:Ue.sibling=We,Ue=We);return He&&Fn(W,Re),xe}for(be=s(be);!We.done;Re++,We=K.next())We=Q(be,W,Re,We.value,oe),We!==null&&(e&&We.alternate!==null&&be.delete(We.key===null?Re:We.key),H=h(We,H,Re),Ue===null?xe=We:Ue.sibling=We,Ue=We);return e&&be.forEach(function(M2){return n(W,M2)}),He&&Fn(W,Re),xe}function Ye(W,H,K,oe){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 xe=K.key;H!==null;){if(H.key===xe){if(xe=K.type,xe===w){if(H.tag===7){r(W,H.sibling),oe=d(H,K.props.children),oe.return=W,W=oe;break e}}else if(H.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===U&&cr(xe)===H.type){r(W,H.sibling),oe=d(H,K.props),as(oe,K),oe.return=W,W=oe;break e}r(W,H);break}else n(W,H);H=H.sibling}K.type===w?(oe=rr(K.props.children,W.mode,oe,K.key),oe.return=W,W=oe):(oe=Ei(K.type,K.key,K.props,null,W.mode,oe),as(oe,K),oe.return=W,W=oe)}return x(W);case T:e:{for(xe=K.key;H!==null;){if(H.key===xe)if(H.tag===4&&H.stateNode.containerInfo===K.containerInfo&&H.stateNode.implementation===K.implementation){r(W,H.sibling),oe=d(H,K.children||[]),oe.return=W,W=oe;break e}else{r(W,H);break}else n(W,H);H=H.sibling}oe=cu(K,W.mode,oe),oe.return=W,W=oe}return x(W);case U:return K=cr(K),Ye(W,H,K,oe)}if(V(K))return he(W,H,K,oe);if(F(K)){if(xe=F(K),typeof xe!="function")throw Error(i(150));return K=xe.call(K),Ce(W,H,K,oe)}if(typeof K.then=="function")return Ye(W,H,Ri(K),oe);if(K.$$typeof===_)return Ye(W,H,Ni(W,K),oe);Oi(W,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,H!==null&&H.tag===6?(r(W,H.sibling),oe=d(H,K),oe.return=W,W=oe):(r(W,H),oe=lu(K,W.mode,oe),oe.return=W,W=oe),x(W)):r(W,H)}return function(W,H,K,oe){try{ns=0;var xe=Ye(W,H,K,oe);return Vr=null,xe}catch(be){if(be===Yr||be===Ai)throw be;var Ue=Ft(29,be,null,W.mode);return Ue.lanes=oe,Ue.return=W,Ue}}}var dr=ch(!0),uh=ch(!1),va=!1;function xu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ku(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 ya(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ba(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=Si(e),Vp(e,null,r),n}return ki(e,s,n,r),Si(e)}function rs(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,tp(e,r)}}function Su(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 Eu=!1;function os(){if(Eu){var e=Kr;if(e!==null)throw e}}function ss(e,n,r,s){Eu=!1;var d=e.updateQueue;va=!1;var h=d.firstBaseUpdate,x=d.lastBaseUpdate,A=d.shared.pending;if(A!==null){d.shared.pending=null;var z=A,Y=z.next;z.next=null,x===null?h=Y:x.next=Y,x=z;var te=e.alternate;te!==null&&(te=te.updateQueue,A=te.lastBaseUpdate,A!==x&&(A===null?te.firstBaseUpdate=Y:A.next=Y,te.lastBaseUpdate=z))}if(h!==null){var se=d.baseState;x=0,te=Y=z=null,A=h;do{var G=A.lane&-536870913,Q=G!==A.lane;if(Q?(Le&G)===G:(s&G)===G){G!==0&&G===Fr&&(Eu=!0),te!==null&&(te=te.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var he=e,Ce=A;G=n;var Ye=r;switch(Ce.tag){case 1:if(he=Ce.payload,typeof he=="function"){se=he.call(Ye,se,G);break e}se=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=Ce.payload,G=typeof he=="function"?he.call(Ye,se,G):he,G==null)break e;se=v({},se,G);break e;case 2:va=!0}}G=A.callback,G!==null&&(e.flags|=64,Q&&(e.flags|=8192),Q=d.callbacks,Q===null?d.callbacks=[G]:Q.push(G))}else Q={lane:G,tag:A.tag,payload:A.payload,callback:A.callback,next:null},te===null?(Y=te=Q,z=se):te=te.next=Q,x|=G;if(A=A.next,A===null){if(A=d.shared.pending,A===null)break;Q=A,A=Q.next,Q.next=null,d.lastBaseUpdate=Q,d.shared.pending=null}}while(!0);te===null&&(z=se),d.baseState=z,d.firstBaseUpdate=Y,d.lastBaseUpdate=te,h===null&&(d.shared.lanes=0),Ea|=x,e.lanes=x,e.memoizedState=se}}function dh(e,n){if(typeof e!="function")throw Error(i(191,e));e.call(n)}function fh(e,n){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)dh(r[e],n)}var $r=R(null),Di=R(0);function mh(e,n){e=ta,re(Di,e),re($r,n),ta=e|n.baseLanes}function Cu(){re(Di,ta),re($r,$r.current)}function Tu(){ta=Di.current,B($r),B(Di)}var Kt=R(null),un=null;function wa(e){var n=e.alternate;re(tt,tt.current&1),re(Kt,e),un===null&&(n===null||$r.current!==null||n.memoizedState!==null)&&(un=e)}function Nu(e){re(tt,tt.current),re(Kt,e),un===null&&(un=e)}function ph(e){e.tag===22?(re(tt,tt.current),re(Kt,e),un===null&&(un=e)):xa()}function xa(){re(tt,tt.current),re(Kt,Kt.current)}function Yt(e){B(Kt),un===e&&(un=null),B(tt)}var tt=R(0);function Mi(e){for(var n=e;n!==null;){if(n.tag===13){var r=n.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Dd(r)||Md(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 Vn=0,_e=null,Fe=null,st=null,Li=!1,Gr=!1,fr=!1,zi=0,is=0,Xr=null,Ek=0;function Je(){throw Error(i(321))}function ju(e,n){if(n===null)return!1;for(var r=0;r<n.length&&r<e.length;r++)if(!Pt(e[r],n[r]))return!1;return!0}function Au(e,n,r,s,d,h){return Vn=h,_e=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,D.H=e===null||e.memoizedState===null?Zh:Fu,fr=!1,h=r(s,d),fr=!1,Gr&&(h=gh(n,r,s,d)),hh(e),h}function hh(e){D.H=us;var n=Fe!==null&&Fe.next!==null;if(Vn=0,st=Fe=_e=null,Li=!1,is=0,Xr=null,n)throw Error(i(300));e===null||it||(e=e.dependencies,e!==null&&Ti(e)&&(it=!0))}function gh(e,n,r,s){_e=e;var d=0;do{if(Gr&&(Xr=null),is=0,Gr=!1,25<=d)throw Error(i(301));if(d+=1,st=Fe=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}D.H=Qh,h=n(r,s)}while(Gr);return h}function Ck(){var e=D.H,n=e.useState()[0];return n=typeof n.then=="function"?ls(n):n,e=e.useState()[0],(Fe!==null?Fe.memoizedState:null)!==e&&(_e.flags|=1024),n}function _u(){var e=zi!==0;return zi=0,e}function Ru(e,n,r){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~r}function Ou(e){if(Li){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Li=!1}Vn=0,st=Fe=_e=null,Gr=!1,is=zi=0,Xr=null}function Tt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return st===null?_e.memoizedState=st=e:st=st.next=e,st}function nt(){if(Fe===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=Fe.next;var n=st===null?_e.memoizedState:st.next;if(n!==null)st=n,Fe=e;else{if(e===null)throw _e.alternate===null?Error(i(467)):Error(i(310));Fe=e,e={memoizedState:Fe.memoizedState,baseState:Fe.baseState,baseQueue:Fe.baseQueue,queue:Fe.queue,next:null},st===null?_e.memoizedState=st=e:st=st.next=e}return st}function Hi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ls(e){var n=is;return is+=1,Xr===null&&(Xr=[]),e=sh(Xr,e,n),n=_e,(st===null?n.memoizedState:st.next)===null&&(n=n.alternate,D.H=n===null||n.memoizedState===null?Zh:Fu),e}function Bi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ls(e);if(e.$$typeof===_)return ht(e)}throw Error(i(438,String(e)))}function Du(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=Hi(),_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 $n(e,n){return typeof n=="function"?n(e):n}function Ui(e){var n=nt();return Mu(n,Fe,e)}function Mu(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 A=x=null,z=null,Y=n,te=!1;do{var se=Y.lane&-536870913;if(se!==Y.lane?(Le&se)===se:(Vn&se)===se){var G=Y.revertLane;if(G===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),se===Fr&&(te=!0);else if((Vn&G)===G){Y=Y.next,G===Fr&&(te=!0);continue}else se={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},z===null?(A=z=se,x=h):z=z.next=se,_e.lanes|=G,Ea|=G;se=Y.action,fr&&r(h,se),h=Y.hasEagerState?Y.eagerState:r(h,se)}else G={lane:se,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},z===null?(A=z=G,x=h):z=z.next=G,_e.lanes|=se,Ea|=se;Y=Y.next}while(Y!==null&&Y!==n);if(z===null?x=h:z.next=A,!Pt(h,e.memoizedState)&&(it=!0,te&&(r=Kr,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 Lu(e){var n=nt(),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);Pt(h,n.memoizedState)||(it=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),r.lastRenderedState=h}return[h,s]}function vh(e,n,r){var s=_e,d=nt(),h=He;if(h){if(r===void 0)throw Error(i(407));r=r()}else r=n();var x=!Pt((Fe||d).memoizedState,r);if(x&&(d.memoizedState=r,it=!0),d=d.queue,Bu(wh.bind(null,s,d,e),[e]),d.getSnapshot!==n||x||st!==null&&st.memoizedState.tag&1){if(s.flags|=2048,Zr(9,{destroy:void 0},bh.bind(null,s,d,r,n),null),Ve===null)throw Error(i(349));h||(Vn&127)!==0||yh(s,n,r)}return r}function yh(e,n,r){e.flags|=16384,e={getSnapshot:n,value:r},n=_e.updateQueue,n===null?(n=Hi(),_e.updateQueue=n,n.stores=[e]):(r=n.stores,r===null?n.stores=[e]:r.push(e))}function bh(e,n,r,s){n.value=r,n.getSnapshot=s,xh(n)&&kh(e)}function wh(e,n,r){return r(function(){xh(n)&&kh(e)})}function xh(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!Pt(e,r)}catch{return!0}}function kh(e){var n=ar(e,2);n!==null&&Mt(n,e,2)}function zu(e){var n=Tt();if(typeof e=="function"){var r=e;if(e=r(),fr){ua(!0);try{r()}finally{ua(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$n,lastRenderedState:e},n}function Sh(e,n,r,s){return e.baseState=r,Mu(e,Fe,typeof s=="function"?s:$n)}function Tk(e,n,r,s,d){if(qi(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)}};D.T!==null?r(!0):h.isTransition=!1,s(h),r=n.pending,r===null?(h.next=n.pending=h,Eh(n,h)):(h.next=r.next,n.pending=r.next=h)}}function Eh(e,n){var r=n.action,s=n.payload,d=e.state;if(n.isTransition){var h=D.T,x={};D.T=x;try{var A=r(d,s),z=D.S;z!==null&&z(x,A),Ch(e,n,A)}catch(Y){Hu(e,n,Y)}finally{h!==null&&x.types!==null&&(h.types=x.types),D.T=h}}else try{h=r(d,s),Ch(e,n,h)}catch(Y){Hu(e,n,Y)}}function Ch(e,n,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(s){Th(e,n,s)},function(s){return Hu(e,n,s)}):Th(e,n,r)}function Th(e,n,r){n.status="fulfilled",n.value=r,Nh(n),e.state=r,n=e.pending,n!==null&&(r=n.next,r===n?e.pending=null:(r=r.next,n.next=r,Eh(e,r)))}function Hu(e,n,r){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=r,Nh(n),n=n.next;while(n!==s)}e.action=null}function Nh(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function jh(e,n){return n}function Ah(e,n){if(He){var r=Ve.formState;if(r!==null){e:{var s=_e;if(He){if(Ge){t:{for(var d=Ge,h=cn;d.nodeType!==8;){if(!h){d=null;break t}if(d=dn(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){Ge=dn(d.nextSibling),s=d.data==="F!";break e}}ha(s)}s=!1}s&&(n=r[0])}}return r=Tt(),r.memoizedState=r.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jh,lastRenderedState:n},r.queue=s,r=$h.bind(null,_e,s),s.dispatch=r,s=zu(!1),h=Pu.bind(null,_e,!1,s.queue),s=Tt(),d={state:n,dispatch:null,action:e,pending:null},s.queue=d,r=Tk.bind(null,_e,d,h,r),d.dispatch=r,s.memoizedState=e,[n,r,!1]}function _h(e){var n=nt();return Rh(n,Fe,e)}function Rh(e,n,r){if(n=Mu(e,n,jh)[0],e=Ui($n)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=ls(n)}catch(x){throw x===Yr?Ai:x}else s=n;n=nt();var d=n.queue,h=d.dispatch;return r!==n.memoizedState&&(_e.flags|=2048,Zr(9,{destroy:void 0},Nk.bind(null,d,r),null)),[s,h,e]}function Nk(e,n){e.action=n}function Oh(e){var n=nt(),r=Fe;if(r!==null)return Rh(n,r,e);nt(),n=n.memoizedState,r=nt();var s=r.queue.dispatch;return r.memoizedState=e,[n,s,!1]}function Zr(e,n,r,s){return e={tag:e,create:r,deps:s,inst:n,next:null},n=_e.updateQueue,n===null&&(n=Hi(),_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 Dh(){return nt().memoizedState}function Wi(e,n,r,s){var d=Tt();_e.flags|=e,d.memoizedState=Zr(1|n,{destroy:void 0},r,s===void 0?null:s)}function Ii(e,n,r,s){var d=nt();s=s===void 0?null:s;var h=d.memoizedState.inst;Fe!==null&&s!==null&&ju(s,Fe.memoizedState.deps)?d.memoizedState=Zr(n,h,r,s):(_e.flags|=e,d.memoizedState=Zr(1|n,h,r,s))}function Mh(e,n){Wi(8390656,8,e,n)}function Bu(e,n){Ii(2048,8,e,n)}function jk(e){_e.flags|=4;var n=_e.updateQueue;if(n===null)n=Hi(),_e.updateQueue=n,n.events=[e];else{var r=n.events;r===null?n.events=[e]:r.push(e)}}function Lh(e){var n=nt().memoizedState;return jk({ref:n,nextImpl:e}),function(){if((Ie&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}function zh(e,n){return Ii(4,2,e,n)}function Hh(e,n){return Ii(4,4,e,n)}function Bh(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 Uh(e,n,r){r=r!=null?r.concat([e]):null,Ii(4,4,Bh.bind(null,n,e),r)}function Uu(){}function Wh(e,n){var r=nt();n=n===void 0?null:n;var s=r.memoizedState;return n!==null&&ju(n,s[1])?s[0]:(r.memoizedState=[e,n],e)}function Ih(e,n){var r=nt();n=n===void 0?null:n;var s=r.memoizedState;if(n!==null&&ju(n,s[1]))return s[0];if(s=e(),fr){ua(!0);try{e()}finally{ua(!1)}}return r.memoizedState=[s,n],s}function Wu(e,n,r){return r===void 0||(Vn&1073741824)!==0&&(Le&261930)===0?e.memoizedState=n:(e.memoizedState=r,e=qg(),_e.lanes|=e,Ea|=e,r)}function qh(e,n,r,s){return Pt(r,n)?r:$r.current!==null?(e=Wu(e,r,s),Pt(e,n)||(it=!0),e):(Vn&42)===0||(Vn&1073741824)!==0&&(Le&261930)===0?(it=!0,e.memoizedState=r):(e=qg(),_e.lanes|=e,Ea|=e,n)}function Ph(e,n,r,s,d){var h=P.p;P.p=h!==0&&8>h?h:8;var x=D.T,A={};D.T=A,Pu(e,!1,n,r);try{var z=d(),Y=D.S;if(Y!==null&&Y(A,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var te=Sk(z,s);cs(e,n,te,Gt(e))}else cs(e,n,s,Gt(e))}catch(se){cs(e,n,{then:function(){},status:"rejected",reason:se},Gt())}finally{P.p=h,x!==null&&A.types!==null&&(x.types=A.types),D.T=x}}function Ak(){}function Iu(e,n,r,s){if(e.tag!==5)throw Error(i(476));var d=Fh(e).queue;Ph(e,d,n,I,r===null?Ak:function(){return Kh(e),r(s)})}function Fh(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:$n,lastRenderedState:I},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$n,lastRenderedState:r},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Kh(e){var n=Fh(e);n.next===null&&(n=e.alternate.memoizedState),cs(e,n.next.queue,{},Gt())}function qu(){return ht(Ts)}function Yh(){return nt().memoizedState}function Vh(){return nt().memoizedState}function _k(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var r=Gt();e=ya(r);var s=ba(n,e,r);s!==null&&(Mt(s,n,r),rs(s,n,r)),n={cache:vu()},e.payload=n;return}n=n.return}}function Rk(e,n,r){var s=Gt();r={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},qi(e)?Gh(n,r):(r=su(e,n,r,s),r!==null&&(Mt(r,e,s),Xh(r,n,s)))}function $h(e,n,r){var s=Gt();cs(e,n,r,s)}function cs(e,n,r,s){var d={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(qi(e))Gh(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,A=h(x,r);if(d.hasEagerState=!0,d.eagerState=A,Pt(A,x))return ki(e,n,d,0),Ve===null&&xi(),!1}catch{}if(r=su(e,n,d,s),r!==null)return Mt(r,e,s),Xh(r,n,s),!0}return!1}function Pu(e,n,r,s){if(s={lane:2,revertLane:xd(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},qi(e)){if(n)throw Error(i(479))}else n=su(e,r,s,2),n!==null&&Mt(n,e,2)}function qi(e){var n=e.alternate;return e===_e||n!==null&&n===_e}function Gh(e,n){Gr=Li=!0;var r=e.pending;r===null?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function Xh(e,n,r){if((r&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,r|=s,n.lanes=r,tp(e,r)}}var us={readContext:ht,use:Bi,useCallback:Je,useContext:Je,useEffect:Je,useImperativeHandle:Je,useLayoutEffect:Je,useInsertionEffect:Je,useMemo:Je,useReducer:Je,useRef:Je,useState:Je,useDebugValue:Je,useDeferredValue:Je,useTransition:Je,useSyncExternalStore:Je,useId:Je,useHostTransitionStatus:Je,useFormState:Je,useActionState:Je,useOptimistic:Je,useMemoCache:Je,useCacheRefresh:Je};us.useEffectEvent=Je;var Zh={readContext:ht,use:Bi,useCallback:function(e,n){return Tt().memoizedState=[e,n===void 0?null:n],e},useContext:ht,useEffect:Mh,useImperativeHandle:function(e,n,r){r=r!=null?r.concat([e]):null,Wi(4194308,4,Bh.bind(null,n,e),r)},useLayoutEffect:function(e,n){return Wi(4194308,4,e,n)},useInsertionEffect:function(e,n){Wi(4,2,e,n)},useMemo:function(e,n){var r=Tt();n=n===void 0?null:n;var s=e();if(fr){ua(!0);try{e()}finally{ua(!1)}}return r.memoizedState=[s,n],s},useReducer:function(e,n,r){var s=Tt();if(r!==void 0){var d=r(n);if(fr){ua(!0);try{r(n)}finally{ua(!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=Rk.bind(null,_e,e),[s.memoizedState,e]},useRef:function(e){var n=Tt();return e={current:e},n.memoizedState=e},useState:function(e){e=zu(e);var n=e.queue,r=$h.bind(null,_e,n);return n.dispatch=r,[e.memoizedState,r]},useDebugValue:Uu,useDeferredValue:function(e,n){var r=Tt();return Wu(r,e,n)},useTransition:function(){var e=zu(!1);return e=Ph.bind(null,_e,e.queue,!0,!1),Tt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,r){var s=_e,d=Tt();if(He){if(r===void 0)throw Error(i(407));r=r()}else{if(r=n(),Ve===null)throw Error(i(349));(Le&127)!==0||yh(s,n,r)}d.memoizedState=r;var h={value:r,getSnapshot:n};return d.queue=h,Mh(wh.bind(null,s,h,e),[e]),s.flags|=2048,Zr(9,{destroy:void 0},bh.bind(null,s,h,r,n),null),r},useId:function(){var e=Tt(),n=Ve.identifierPrefix;if(He){var r=jn,s=Nn;r=(s&~(1<<32-qt(s)-1)).toString(32)+r,n="_"+n+"R_"+r,r=zi++,0<r&&(n+="H"+r.toString(32)),n+="_"}else r=Ek++,n="_"+n+"r_"+r.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:qu,useFormState:Ah,useActionState:Ah,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=Pu.bind(null,_e,!0,r),r.dispatch=n,[e,n]},useMemoCache:Du,useCacheRefresh:function(){return Tt().memoizedState=_k.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)}}},Fu={readContext:ht,use:Bi,useCallback:Wh,useContext:ht,useEffect:Bu,useImperativeHandle:Uh,useInsertionEffect:zh,useLayoutEffect:Hh,useMemo:Ih,useReducer:Ui,useRef:Dh,useState:function(){return Ui($n)},useDebugValue:Uu,useDeferredValue:function(e,n){var r=nt();return qh(r,Fe.memoizedState,e,n)},useTransition:function(){var e=Ui($n)[0],n=nt().memoizedState;return[typeof e=="boolean"?e:ls(e),n]},useSyncExternalStore:vh,useId:Yh,useHostTransitionStatus:qu,useFormState:_h,useActionState:_h,useOptimistic:function(e,n){var r=nt();return Sh(r,Fe,e,n)},useMemoCache:Du,useCacheRefresh:Vh};Fu.useEffectEvent=Lh;var Qh={readContext:ht,use:Bi,useCallback:Wh,useContext:ht,useEffect:Bu,useImperativeHandle:Uh,useInsertionEffect:zh,useLayoutEffect:Hh,useMemo:Ih,useReducer:Lu,useRef:Dh,useState:function(){return Lu($n)},useDebugValue:Uu,useDeferredValue:function(e,n){var r=nt();return Fe===null?Wu(r,e,n):qh(r,Fe.memoizedState,e,n)},useTransition:function(){var e=Lu($n)[0],n=nt().memoizedState;return[typeof e=="boolean"?e:ls(e),n]},useSyncExternalStore:vh,useId:Yh,useHostTransitionStatus:qu,useFormState:Oh,useActionState:Oh,useOptimistic:function(e,n){var r=nt();return Fe!==null?Sh(r,Fe,e,n):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:Du,useCacheRefresh:Vh};Qh.useEffectEvent=Lh;function Ku(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 Yu={enqueueSetState:function(e,n,r){e=e._reactInternals;var s=Gt(),d=ya(s);d.payload=n,r!=null&&(d.callback=r),n=ba(e,d,s),n!==null&&(Mt(n,e,s),rs(n,e,s))},enqueueReplaceState:function(e,n,r){e=e._reactInternals;var s=Gt(),d=ya(s);d.tag=1,d.payload=n,r!=null&&(d.callback=r),n=ba(e,d,s),n!==null&&(Mt(n,e,s),rs(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var r=Gt(),s=ya(r);s.tag=2,n!=null&&(s.callback=n),n=ba(e,s,r),n!==null&&(Mt(n,e,r),rs(n,e,r))}};function Jh(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?!Xo(r,s)||!Xo(d,h):!0}function eg(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&&Yu.enqueueReplaceState(n,n.state,null)}function mr(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 tg(e){wi(e)}function ng(e){console.error(e)}function ag(e){wi(e)}function Pi(e,n){try{var r=e.onUncaughtError;r(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function rg(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 Vu(e,n,r){return r=ya(r),r.tag=3,r.payload={element:null},r.callback=function(){Pi(e,n)},r}function og(e){return e=ya(e),e.tag=3,e}function sg(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(){rg(n,r,s)}}var x=r.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){rg(n,r,s),typeof d!="function"&&(Ca===null?Ca=new Set([this]):Ca.add(this));var A=s.stack;this.componentDidCatch(s.value,{componentStack:A!==null?A:""})})}function Ok(e,n,r,s,d){if(r.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=r.alternate,n!==null&&Pr(n,r,d,!0),r=Kt.current,r!==null){switch(r.tag){case 31:case 13:return un===null?tl():r.alternate===null&&et===0&&(et=3),r.flags&=-257,r.flags|=65536,r.lanes=d,s===_i?r.flags|=16384:(n=r.updateQueue,n===null?r.updateQueue=new Set([s]):n.add(s),yd(e,s,d)),!1;case 22:return r.flags|=65536,s===_i?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)),yd(e,s,d)),!1}throw Error(i(435,r.tag))}return yd(e,s,d),tl(),!1}if(He)return n=Kt.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=d,s!==fu&&(e=Error(i(422),{cause:s}),Jo(on(e,r)))):(s!==fu&&(n=Error(i(423),{cause:s}),Jo(on(n,r))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,s=on(s,r),d=Vu(e.stateNode,s,d),Su(e,d),et!==4&&(et=2)),!1;var h=Error(i(520),{cause:s});if(h=on(h,r),ys===null?ys=[h]:ys.push(h),et!==4&&(et=2),n===null)return!0;s=on(s,r),r=n;do{switch(r.tag){case 3:return r.flags|=65536,e=d&-d,r.lanes|=e,e=Vu(r.stateNode,s,e),Su(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"&&(Ca===null||!Ca.has(h))))return r.flags|=65536,d&=-d,r.lanes|=d,d=og(d),sg(d,e,r,s),Su(r,d),!1}r=r.return}while(r!==null);return!1}var $u=Error(i(461)),it=!1;function gt(e,n,r,s){n.child=e===null?uh(n,null,r,s):dr(n,e.child,r,s)}function ig(e,n,r,s,d){r=r.render;var h=n.ref;if("ref"in s){var x={};for(var A in s)A!=="ref"&&(x[A]=s[A])}else x=s;return ir(n),s=Au(e,n,r,x,h,d),A=_u(),e!==null&&!it?(Ru(e,n,d),Gn(e,n,d)):(He&&A&&uu(n),n.flags|=1,gt(e,n,s,d),n.child)}function lg(e,n,r,s,d){if(e===null){var h=r.type;return typeof h=="function"&&!iu(h)&&h.defaultProps===void 0&&r.compare===null?(n.tag=15,n.type=h,cg(e,n,h,s,d)):(e=Ei(r.type,null,s,n,n.mode,d),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!nd(e,d)){var x=h.memoizedProps;if(r=r.compare,r=r!==null?r:Xo,r(x,s)&&e.ref===n.ref)return Gn(e,n,d)}return n.flags|=1,e=Pn(h,s),e.ref=n.ref,e.return=n,n.child=e}function cg(e,n,r,s,d){if(e!==null){var h=e.memoizedProps;if(Xo(h,s)&&e.ref===n.ref)if(it=!1,n.pendingProps=s=h,nd(e,d))(e.flags&131072)!==0&&(it=!0);else return n.lanes=e.lanes,Gn(e,n,d)}return Gu(e,n,r,s,d)}function ug(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 dg(e,n,h,r,s)}if((r&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&ji(n,h!==null?h.cachePool:null),h!==null?mh(n,h):Cu(),ph(n);else return s=n.lanes=536870912,dg(e,n,h!==null?h.baseLanes|r:r,r,s)}else h!==null?(ji(n,h.cachePool),mh(n,h),xa(),n.memoizedState=null):(e!==null&&ji(n,null),Cu(),xa());return gt(e,n,d,r),n.child}function ds(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function dg(e,n,r,s,d){var h=bu();return h=h===null?null:{parent:ot._currentValue,pool:h},n.memoizedState={baseLanes:r,cachePool:h},e!==null&&ji(n,null),Cu(),ph(n),e!==null&&Pr(e,n,s,!0),n.childLanes=d,null}function Fi(e,n){return n=Yi({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function fg(e,n,r){return dr(n,e.child,null,r),e=Fi(n,n.pendingProps),e.flags|=2,Yt(n),n.memoizedState=null,e}function Dk(e,n,r){var s=n.pendingProps,d=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(He){if(s.mode==="hidden")return e=Fi(n,s),n.lanes=536870912,ds(null,e);if(Nu(n),(e=Ge)?(e=Ev(e,cn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ma!==null?{id:Nn,overflow:jn}:null,retryLane:536870912,hydrationErrors:null},r=Gp(e),r.return=n,n.child=r,pt=n,Ge=null)):e=null,e===null)throw ha(n);return n.lanes=536870912,null}return Fi(n,s)}var h=e.memoizedState;if(h!==null){var x=h.dehydrated;if(Nu(n),d)if(n.flags&256)n.flags&=-257,n=fg(e,n,r);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(i(558));else if(it||Pr(e,n,r,!1),d=(r&e.childLanes)!==0,it||d){if(s=Ve,s!==null&&(x=np(s,r),x!==0&&x!==h.retryLane))throw h.retryLane=x,ar(e,x),Mt(s,e,x),$u;tl(),n=fg(e,n,r)}else e=h.treeContext,Ge=dn(x.nextSibling),pt=n,He=!0,pa=null,cn=!1,e!==null&&Qp(n,e),n=Fi(n,s),n.flags|=4096;return n}return e=Pn(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Ki(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 Gu(e,n,r,s,d){return ir(n),r=Au(e,n,r,s,void 0,d),s=_u(),e!==null&&!it?(Ru(e,n,d),Gn(e,n,d)):(He&&s&&uu(n),n.flags|=1,gt(e,n,r,d),n.child)}function mg(e,n,r,s,d,h){return ir(n),n.updateQueue=null,r=gh(n,s,r,d),hh(e),s=_u(),e!==null&&!it?(Ru(e,n,h),Gn(e,n,h)):(He&&s&&uu(n),n.flags|=1,gt(e,n,r,h),n.child)}function pg(e,n,r,s,d){if(ir(n),n.stateNode===null){var h=Ur,x=r.contextType;typeof x=="object"&&x!==null&&(h=ht(x)),h=new r(s,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Yu,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=s,h.state=n.memoizedState,h.refs={},xu(n),x=r.contextType,h.context=typeof x=="object"&&x!==null?ht(x):Ur,h.state=n.memoizedState,x=r.getDerivedStateFromProps,typeof x=="function"&&(Ku(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&&Yu.enqueueReplaceState(h,h.state,null),ss(n,s,h,d),os(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){h=n.stateNode;var A=n.memoizedProps,z=mr(r,A);h.props=z;var Y=h.context,te=r.contextType;x=Ur,typeof te=="object"&&te!==null&&(x=ht(te));var se=r.getDerivedStateFromProps;te=typeof se=="function"||typeof h.getSnapshotBeforeUpdate=="function",A=n.pendingProps!==A,te||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(A||Y!==x)&&eg(n,h,s,x),va=!1;var G=n.memoizedState;h.state=G,ss(n,s,h,d),os(),Y=n.memoizedState,A||G!==Y||va?(typeof se=="function"&&(Ku(n,r,se,s),Y=n.memoizedState),(z=va||Jh(n,r,z,s,G,Y,x))?(te||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,ku(e,n),x=n.memoizedProps,te=mr(r,x),h.props=te,se=n.pendingProps,G=h.context,Y=r.contextType,z=Ur,typeof Y=="object"&&Y!==null&&(z=ht(Y)),A=r.getDerivedStateFromProps,(Y=typeof A=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(x!==se||G!==z)&&eg(n,h,s,z),va=!1,G=n.memoizedState,h.state=G,ss(n,s,h,d),os();var Q=n.memoizedState;x!==se||G!==Q||va||e!==null&&e.dependencies!==null&&Ti(e.dependencies)?(typeof A=="function"&&(Ku(n,r,A,s),Q=n.memoizedState),(te=va||Jh(n,r,te,s,G,Q,z)||e!==null&&e.dependencies!==null&&Ti(e.dependencies))?(Y||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(s,Q,z),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(s,Q,z)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=Q),h.props=s,h.state=Q,h.context=z,s=te):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),s=!1)}return h=s,Ki(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=dr(n,e.child,null,d),n.child=dr(n,null,r,d)):gt(e,n,r,d),n.memoizedState=h.state,e=n.child):e=Gn(e,n,d),e}function hg(e,n,r,s){return or(),n.flags|=256,gt(e,n,r,s),n.child}var Xu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zu(e){return{baseLanes:e,cachePool:rh()}}function Qu(e,n,r){return e=e!==null?e.childLanes&~r:0,n&&(e|=$t),e}function gg(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:(tt.current&2)!==0),x&&(d=!0,n.flags&=-129),x=(n.flags&32)!==0,n.flags&=-33,e===null){if(He){if(d?wa(n):xa(),(e=Ge)?(e=Ev(e,cn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ma!==null?{id:Nn,overflow:jn}:null,retryLane:536870912,hydrationErrors:null},r=Gp(e),r.return=n,n.child=r,pt=n,Ge=null)):e=null,e===null)throw ha(n);return Md(e)?n.lanes=32:n.lanes=536870912,null}var A=s.children;return s=s.fallback,d?(xa(),d=n.mode,A=Yi({mode:"hidden",children:A},d),s=rr(s,d,r,null),A.return=n,s.return=n,A.sibling=s,n.child=A,s=n.child,s.memoizedState=Zu(r),s.childLanes=Qu(e,x,r),n.memoizedState=Xu,ds(null,s)):(wa(n),Ju(n,A))}var z=e.memoizedState;if(z!==null&&(A=z.dehydrated,A!==null)){if(h)n.flags&256?(wa(n),n.flags&=-257,n=ed(e,n,r)):n.memoizedState!==null?(xa(),n.child=e.child,n.flags|=128,n=null):(xa(),A=s.fallback,d=n.mode,s=Yi({mode:"visible",children:s.children},d),A=rr(A,d,r,null),A.flags|=2,s.return=n,A.return=n,s.sibling=A,n.child=s,dr(n,e.child,null,r),s=n.child,s.memoizedState=Zu(r),s.childLanes=Qu(e,x,r),n.memoizedState=Xu,n=ds(null,s));else if(wa(n),Md(A)){if(x=A.nextSibling&&A.nextSibling.dataset,x)var Y=x.dgst;x=Y,s=Error(i(419)),s.stack="",s.digest=x,Jo({value:s,source:null,stack:null}),n=ed(e,n,r)}else if(it||Pr(e,n,r,!1),x=(r&e.childLanes)!==0,it||x){if(x=Ve,x!==null&&(s=np(x,r),s!==0&&s!==z.retryLane))throw z.retryLane=s,ar(e,s),Mt(x,e,s),$u;Dd(A)||tl(),n=ed(e,n,r)}else Dd(A)?(n.flags|=192,n.child=e.child,n=null):(e=z.treeContext,Ge=dn(A.nextSibling),pt=n,He=!0,pa=null,cn=!1,e!==null&&Qp(n,e),n=Ju(n,s.children),n.flags|=4096);return n}return d?(xa(),A=s.fallback,d=n.mode,z=e.child,Y=z.sibling,s=Pn(z,{mode:"hidden",children:s.children}),s.subtreeFlags=z.subtreeFlags&65011712,Y!==null?A=Pn(Y,A):(A=rr(A,d,r,null),A.flags|=2),A.return=n,s.return=n,s.sibling=A,n.child=s,ds(null,s),s=n.child,A=e.child.memoizedState,A===null?A=Zu(r):(d=A.cachePool,d!==null?(z=ot._currentValue,d=d.parent!==z?{parent:z,pool:z}:d):d=rh(),A={baseLanes:A.baseLanes|r,cachePool:d}),s.memoizedState=A,s.childLanes=Qu(e,x,r),n.memoizedState=Xu,ds(e.child,s)):(wa(n),r=e.child,e=r.sibling,r=Pn(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 Ju(e,n){return n=Yi({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Yi(e,n){return e=Ft(22,e,null,n),e.lanes=0,e}function ed(e,n,r){return dr(n,e.child,null,r),e=Ju(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function vg(e,n,r){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),hu(e.return,n,r)}function td(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 yg(e,n,r){var s=n.pendingProps,d=s.revealOrder,h=s.tail;s=s.children;var x=tt.current,A=(x&2)!==0;if(A?(x=x&1|2,n.flags|=128):x&=1,re(tt,x),gt(e,n,s,r),s=He?Qo:0,!A&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vg(e,r,n);else if(e.tag===19)vg(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&&Mi(e)===null&&(d=r),r=r.sibling;r=d,r===null?(d=n.child,n.child=null):(d=r.sibling,r.sibling=null),td(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&&Mi(e)===null){n.child=d;break}e=d.sibling,d.sibling=r,r=d,d=e}td(n,!0,r,null,h,s);break;case"together":td(n,!1,null,null,void 0,s);break;default:n.memoizedState=null}return n.child}function Gn(e,n,r){if(e!==null&&(n.dependencies=e.dependencies),Ea|=n.lanes,(r&n.childLanes)===0)if(e!==null){if(Pr(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=Pn(e,e.pendingProps),n.child=r,r.return=n;e.sibling!==null;)e=e.sibling,r=r.sibling=Pn(e,e.pendingProps),r.return=n;r.sibling=null}return n.child}function nd(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Ti(e)))}function Mk(e,n,r){switch(n.tag){case 3:ie(n,n.stateNode.containerInfo),ga(n,ot,e.memoizedState.cache),or();break;case 27:case 5:ce(n);break;case 4:ie(n,n.stateNode.containerInfo);break;case 10:ga(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Nu(n),null;break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(wa(n),n.flags|=128,null):(r&n.child.childLanes)!==0?gg(e,n,r):(wa(n),e=Gn(e,n,r),e!==null?e.sibling:null);wa(n);break;case 19:var d=(e.flags&128)!==0;if(s=(r&n.childLanes)!==0,s||(Pr(e,n,r,!1),s=(r&n.childLanes)!==0),d){if(s)return yg(e,n,r);n.flags|=128}if(d=n.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),re(tt,tt.current),s)break;return null;case 22:return n.lanes=0,ug(e,n,r,n.pendingProps);case 24:ga(n,ot,e.memoizedState.cache)}return Gn(e,n,r)}function bg(e,n,r){if(e!==null)if(e.memoizedProps!==n.pendingProps)it=!0;else{if(!nd(e,r)&&(n.flags&128)===0)return it=!1,Mk(e,n,r);it=(e.flags&131072)!==0}else it=!1,He&&(n.flags&1048576)!==0&&Zp(n,Qo,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=cr(n.elementType),n.type=e,typeof e=="function")iu(e)?(s=mr(e,s),n.tag=1,n=pg(null,n,e,s,r)):(n.tag=0,n=Gu(null,n,e,s,r));else{if(e!=null){var d=e.$$typeof;if(d===N){n.tag=11,n=ig(null,n,e,s,r);break e}else if(d===L){n.tag=14,n=lg(null,n,e,s,r);break e}}throw n=X(e)||e,Error(i(306,n,""))}}return n;case 0:return Gu(e,n,n.type,n.pendingProps,r);case 1:return s=n.type,d=mr(s,n.pendingProps),pg(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,ku(e,n),ss(n,s,null,r);var x=n.memoizedState;if(s=x.cache,ga(n,ot,s),s!==h.cache&&gu(n,[ot],r,!0),os(),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=hg(e,n,s,r);break e}else if(s!==d){d=on(Error(i(424)),n),Jo(d),n=hg(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,Ge=dn(e.firstChild),pt=n,He=!0,pa=null,cn=!0,r=uh(n,null,s,r),n.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(or(),s===d){n=Gn(e,n,r);break e}gt(e,n,s,r)}n=n.child}return n;case 26:return Ki(e,n),e===null?(r=_v(n.type,null,n.pendingProps,null))?n.memoizedState=r:He||(r=n.type,e=n.pendingProps,s=ll(fe.current).createElement(r),s[mt]=n,s[jt]=e,vt(s,r,e),ut(s),n.stateNode=s):n.memoizedState=_v(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return ce(n),e===null&&He&&(s=n.stateNode=Nv(n.type,n.pendingProps,fe.current),pt=n,cn=!0,d=Ge,Aa(n.type)?(Ld=d,Ge=dn(s.firstChild)):Ge=d),gt(e,n,n.pendingProps.children,r),Ki(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&He&&((d=s=Ge)&&(s=u2(s,n.type,n.pendingProps,cn),s!==null?(n.stateNode=s,pt=n,Ge=dn(s.firstChild),cn=!1,d=!0):d=!1),d||ha(n)),ce(n),d=n.type,h=n.pendingProps,x=e!==null?e.memoizedProps:null,s=h.children,_d(d,h)?s=null:x!==null&&_d(d,x)&&(n.flags|=32),n.memoizedState!==null&&(d=Au(e,n,Ck,null,null,r),Ts._currentValue=d),Ki(e,n),gt(e,n,s,r),n.child;case 6:return e===null&&He&&((e=r=Ge)&&(r=d2(r,n.pendingProps,cn),r!==null?(n.stateNode=r,pt=n,Ge=null,e=!0):e=!1),e||ha(n)),null;case 13:return gg(e,n,r);case 4:return ie(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=dr(n,null,s,r):gt(e,n,s,r),n.child;case 11:return ig(e,n,n.type,n.pendingProps,r);case 7:return gt(e,n,n.pendingProps,r),n.child;case 8:return gt(e,n,n.pendingProps.children,r),n.child;case 12:return gt(e,n,n.pendingProps.children,r),n.child;case 10:return s=n.pendingProps,ga(n,n.type,s.value),gt(e,n,s.children,r),n.child;case 9:return d=n.type._context,s=n.pendingProps.children,ir(n),d=ht(d),s=s(d),n.flags|=1,gt(e,n,s,r),n.child;case 14:return lg(e,n,n.type,n.pendingProps,r);case 15:return cg(e,n,n.type,n.pendingProps,r);case 19:return yg(e,n,r);case 31:return Dk(e,n,r);case 22:return ug(e,n,r,n.pendingProps);case 24:return ir(n),s=ht(ot),e===null?(d=bu(),d===null&&(d=Ve,h=vu(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=r),d=h),n.memoizedState={parent:s,cache:d},xu(n),ga(n,ot,d)):((e.lanes&r)!==0&&(ku(e,n),ss(n,null,null,r),os()),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),ga(n,ot,s)):(s=h.cache,ga(n,ot,s),s!==d.cache&&gu(n,[ot],r,!0))),gt(e,n,n.pendingProps.children,r),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function Xn(e){e.flags|=4}function ad(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(Yg())e.flags|=8192;else throw ur=_i,wu}else e.flags&=-16777217}function wg(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Lv(n))if(Yg())e.flags|=8192;else throw ur=_i,wu}function Vi(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Jm():536870912,e.lanes|=n,to|=n)}function fs(e,n){if(!He)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 Xe(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 Lk(e,n,r){var s=n.pendingProps;switch(du(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(n),null;case 1:return Xe(n),null;case 3:return r=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Yn(ot),le(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(qr(n)?Xn(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,mu())),Xe(n),null;case 26:var d=n.type,h=n.memoizedState;return e===null?(Xn(n),h!==null?(Xe(n),wg(n,h)):(Xe(n),ad(n,d,null,s,r))):h?h!==e.memoizedState?(Xn(n),Xe(n),wg(n,h)):(Xe(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&Xn(n),Xe(n),ad(n,d,e,s,r)),null;case 27:if(me(n),r=fe.current,d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Xn(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return Xe(n),null}e=ne.current,qr(n)?Jp(n):(e=Nv(d,s,r),n.stateNode=e,Xn(n))}return Xe(n),null;case 5:if(me(n),d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Xn(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return Xe(n),null}if(h=ne.current,qr(n))Jp(n);else{var x=ll(fe.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[mt]=n,h[jt]=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(vt(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&&Xn(n)}}return Xe(n),ad(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,r),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&Xn(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(i(166));if(e=fe.current,qr(n)){if(e=n.stateNode,r=n.memoizedProps,s=null,d=pt,d!==null)switch(d.tag){case 27:case 5:s=d.memoizedProps}e[mt]=n,e=!!(e.nodeValue===r||s!==null&&s.suppressHydrationWarning===!0||gv(e.nodeValue,r)),e||ha(n,!0)}else e=ll(e).createTextNode(s),e[mt]=n,n.stateNode=e}return Xe(n),null;case 31:if(r=n.memoizedState,e===null||e.memoizedState!==null){if(s=qr(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[mt]=n}else or(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Xe(n),e=!1}else r=mu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return n.flags&256?(Yt(n),n):(Yt(n),null);if((n.flags&128)!==0)throw Error(i(558))}return Xe(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=qr(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[mt]=n}else or(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Xe(n),d=!1}else d=mu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return n.flags&256?(Yt(n),n):(Yt(n),null)}return Yt(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),Vi(n,n.updateQueue),Xe(n),null);case 4:return le(),e===null&&Cd(n.stateNode.containerInfo),Xe(n),null;case 10:return Yn(n.type),Xe(n),null;case 19:if(B(tt),s=n.memoizedState,s===null)return Xe(n),null;if(d=(n.flags&128)!==0,h=s.rendering,h===null)if(d)fs(s,!1);else{if(et!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=Mi(e),h!==null){for(n.flags|=128,fs(s,!1),e=h.updateQueue,n.updateQueue=e,Vi(n,e),n.subtreeFlags=0,e=r,r=n.child;r!==null;)$p(r,e),r=r.sibling;return re(tt,tt.current&1|2),He&&Fn(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&Oe()>Qi&&(n.flags|=128,d=!0,fs(s,!1),n.lanes=4194304)}else{if(!d)if(e=Mi(h),e!==null){if(n.flags|=128,d=!0,e=e.updateQueue,n.updateQueue=e,Vi(n,e),fs(s,!0),s.tail===null&&s.tailMode==="hidden"&&!h.alternate&&!He)return Xe(n),null}else 2*Oe()-s.renderingStartTime>Qi&&r!==536870912&&(n.flags|=128,d=!0,fs(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=Oe(),e.sibling=null,r=tt.current,re(tt,d?r&1|2:r&1),He&&Fn(n,s.treeForkCount),e):(Xe(n),null);case 22:case 23:return Yt(n),Tu(),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&&(Xe(n),n.subtreeFlags&6&&(n.flags|=8192)):Xe(n),r=n.updateQueue,r!==null&&Vi(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(lr),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),Yn(ot),Xe(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function zk(e,n){switch(du(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Yn(ot),le(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return me(n),null;case 31:if(n.memoizedState!==null){if(Yt(n),n.alternate===null)throw Error(i(340));or()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Yt(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));or()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return B(tt),null;case 4:return le(),null;case 10:return Yn(n.type),null;case 22:case 23:return Yt(n),Tu(),e!==null&&B(lr),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Yn(ot),null;case 25:return null;default:return null}}function xg(e,n){switch(du(n),n.tag){case 3:Yn(ot),le();break;case 26:case 27:case 5:me(n);break;case 4:le();break;case 31:n.memoizedState!==null&&Yt(n);break;case 13:Yt(n);break;case 19:B(tt);break;case 10:Yn(n.type);break;case 22:case 23:Yt(n),Tu(),e!==null&&B(lr);break;case 24:Yn(ot)}}function ms(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(A){Pe(n,n.return,A)}}function ka(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,A=x.destroy;if(A!==void 0){x.destroy=void 0,d=n;var z=r,Y=A;try{Y()}catch(te){Pe(d,z,te)}}}s=s.next}while(s!==h)}}catch(te){Pe(n,n.return,te)}}function kg(e){var n=e.updateQueue;if(n!==null){var r=e.stateNode;try{fh(n,r)}catch(s){Pe(e,e.return,s)}}}function Sg(e,n,r){r.props=mr(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(s){Pe(e,n,s)}}function ps(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){Pe(e,n,d)}}function An(e,n){var r=e.ref,s=e.refCleanup;if(r!==null)if(typeof s=="function")try{s()}catch(d){Pe(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){Pe(e,n,d)}else r.current=null}function Eg(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){Pe(e,e.return,d)}}function rd(e,n,r){try{var s=e.stateNode;r2(s,e.type,r,n),s[jt]=n}catch(d){Pe(e,e.return,d)}}function Cg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Aa(e.type)||e.tag===4}function od(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Cg(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&&Aa(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 sd(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=In));else if(s!==4&&(s===27&&Aa(e.type)&&(r=e.stateNode,n=null),e=e.child,e!==null))for(sd(e,n,r),e=e.sibling;e!==null;)sd(e,n,r),e=e.sibling}function $i(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&&Aa(e.type)&&(r=e.stateNode),e=e.child,e!==null))for($i(e,n,r),e=e.sibling;e!==null;)$i(e,n,r),e=e.sibling}function Tg(e){var n=e.stateNode,r=e.memoizedProps;try{for(var s=e.type,d=n.attributes;d.length;)n.removeAttributeNode(d[0]);vt(n,s,r),n[mt]=e,n[jt]=r}catch(h){Pe(e,e.return,h)}}var Zn=!1,lt=!1,id=!1,Ng=typeof WeakSet=="function"?WeakSet:Set,dt=null;function Hk(e,n){if(e=e.containerInfo,jd=hl,e=Up(e),eu(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,A=-1,z=-1,Y=0,te=0,se=e,G=null;t:for(;;){for(var Q;se!==r||d!==0&&se.nodeType!==3||(A=x+d),se!==h||s!==0&&se.nodeType!==3||(z=x+s),se.nodeType===3&&(x+=se.nodeValue.length),(Q=se.firstChild)!==null;)G=se,se=Q;for(;;){if(se===e)break t;if(G===r&&++Y===d&&(A=x),G===h&&++te===s&&(z=x),(Q=se.nextSibling)!==null)break;se=G,G=se.parentNode}se=Q}r=A===-1||z===-1?null:{start:A,end:z}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ad={focusedElem:e,selectionRange:r},hl=!1,dt=n;dt!==null;)if(n=dt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,dt=e;else for(;dt!==null;){switch(n=dt,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=mr(r.type,d);e=s.getSnapshotBeforeUpdate(he,h),s.__reactInternalSnapshotBeforeUpdate=e}catch(Ce){Pe(r,r.return,Ce)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,r=e.nodeType,r===9)Od(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Od(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,dt=e;break}dt=n.return}}function jg(e,n,r){var s=r.flags;switch(r.tag){case 0:case 11:case 15:Jn(e,r),s&4&&ms(5,r);break;case 1:if(Jn(e,r),s&4)if(e=r.stateNode,n===null)try{e.componentDidMount()}catch(x){Pe(r,r.return,x)}else{var d=mr(r.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(d,n,e.__reactInternalSnapshotBeforeUpdate)}catch(x){Pe(r,r.return,x)}}s&64&&kg(r),s&512&&ps(r,r.return);break;case 3:if(Jn(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{fh(e,n)}catch(x){Pe(r,r.return,x)}}break;case 27:n===null&&s&4&&Tg(r);case 26:case 5:Jn(e,r),n===null&&s&4&&Eg(r),s&512&&ps(r,r.return);break;case 12:Jn(e,r);break;case 31:Jn(e,r),s&4&&Rg(e,r);break;case 13:Jn(e,r),s&4&&Og(e,r),s&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=Yk.bind(null,r),f2(e,r))));break;case 22:if(s=r.memoizedState!==null||Zn,!s){n=n!==null&&n.memoizedState!==null||lt,d=Zn;var h=lt;Zn=s,(lt=n)&&!h?ea(e,r,(r.subtreeFlags&8772)!==0):Jn(e,r),Zn=d,lt=h}break;case 30:break;default:Jn(e,r)}}function Ag(e){var n=e.alternate;n!==null&&(e.alternate=null,Ag(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Hc(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 Ze=null,_t=!1;function Qn(e,n,r){for(r=r.child;r!==null;)_g(e,n,r),r=r.sibling}function _g(e,n,r){if(It&&typeof It.onCommitFiberUnmount=="function")try{It.onCommitFiberUnmount(Bo,r)}catch{}switch(r.tag){case 26:lt||An(r,n),Qn(e,n,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:lt||An(r,n);var s=Ze,d=_t;Aa(r.type)&&(Ze=r.stateNode,_t=!1),Qn(e,n,r),Ss(r.stateNode),Ze=s,_t=d;break;case 5:lt||An(r,n);case 6:if(s=Ze,d=_t,Ze=null,Qn(e,n,r),Ze=s,_t=d,Ze!==null)if(_t)try{(Ze.nodeType===9?Ze.body:Ze.nodeName==="HTML"?Ze.ownerDocument.body:Ze).removeChild(r.stateNode)}catch(h){Pe(r,n,h)}else try{Ze.removeChild(r.stateNode)}catch(h){Pe(r,n,h)}break;case 18:Ze!==null&&(_t?(e=Ze,kv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),co(e)):kv(Ze,r.stateNode));break;case 4:s=Ze,d=_t,Ze=r.stateNode.containerInfo,_t=!0,Qn(e,n,r),Ze=s,_t=d;break;case 0:case 11:case 14:case 15:ka(2,r,n),lt||ka(4,r,n),Qn(e,n,r);break;case 1:lt||(An(r,n),s=r.stateNode,typeof s.componentWillUnmount=="function"&&Sg(r,n,s)),Qn(e,n,r);break;case 21:Qn(e,n,r);break;case 22:lt=(s=lt)||r.memoizedState!==null,Qn(e,n,r),lt=s;break;default:Qn(e,n,r)}}function Rg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{co(e)}catch(r){Pe(n,n.return,r)}}}function Og(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{co(e)}catch(r){Pe(n,n.return,r)}}function Bk(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Ng),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Ng),n;default:throw Error(i(435,e.tag))}}function Gi(e,n){var r=Bk(e);n.forEach(function(s){if(!r.has(s)){r.add(s);var d=Vk.bind(null,e,s);s.then(d,d)}})}function Rt(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,A=x;e:for(;A!==null;){switch(A.tag){case 27:if(Aa(A.type)){Ze=A.stateNode,_t=!1;break e}break;case 5:Ze=A.stateNode,_t=!1;break e;case 3:case 4:Ze=A.stateNode.containerInfo,_t=!0;break e}A=A.return}if(Ze===null)throw Error(i(160));_g(h,x,d),Ze=null,_t=!1,h=d.alternate,h!==null&&(h.return=null),d.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Dg(n,e),n=n.sibling}var vn=null;function Dg(e,n){var r=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Rt(n,e),Ot(e),s&4&&(ka(3,e,e.return),ms(3,e),ka(5,e,e.return));break;case 1:Rt(n,e),Ot(e),s&512&&(lt||r===null||An(r,r.return)),s&64&&Zn&&(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=vn;if(Rt(n,e),Ot(e),s&512&&(lt||r===null||An(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[Io]||h[mt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=d.createElement(s),d.head.insertBefore(h,d.querySelector("head > title"))),vt(h,s,r),h[mt]=e,ut(h),s=h;break e;case"link":var x=Dv("link","href",d).get(s+(r.href||""));if(x){for(var A=0;A<x.length;A++)if(h=x[A],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(A,1);break t}}h=d.createElement(s),vt(h,s,r),d.head.appendChild(h);break;case"meta":if(x=Dv("meta","content",d).get(s+(r.content||""))){for(A=0;A<x.length;A++)if(h=x[A],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(A,1);break t}}h=d.createElement(s),vt(h,s,r),d.head.appendChild(h);break;default:throw Error(i(468,s))}h[mt]=e,ut(h),s=h}e.stateNode=s}else Mv(d,e.type,e.stateNode);else e.stateNode=Ov(d,s,e.memoizedProps);else h!==s?(h===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):h.count--,s===null?Mv(d,e.type,e.stateNode):Ov(d,s,e.memoizedProps)):s===null&&e.stateNode!==null&&rd(e,e.memoizedProps,r.memoizedProps)}break;case 27:Rt(n,e),Ot(e),s&512&&(lt||r===null||An(r,r.return)),r!==null&&s&4&&rd(e,e.memoizedProps,r.memoizedProps);break;case 5:if(Rt(n,e),Ot(e),s&512&&(lt||r===null||An(r,r.return)),e.flags&32){d=e.stateNode;try{Or(d,"")}catch(he){Pe(e,e.return,he)}}s&4&&e.stateNode!=null&&(d=e.memoizedProps,rd(e,d,r!==null?r.memoizedProps:d)),s&1024&&(id=!0);break;case 6:if(Rt(n,e),Ot(e),s&4){if(e.stateNode===null)throw Error(i(162));s=e.memoizedProps,r=e.stateNode;try{r.nodeValue=s}catch(he){Pe(e,e.return,he)}}break;case 3:if(dl=null,d=vn,vn=cl(n.containerInfo),Rt(n,e),vn=d,Ot(e),s&4&&r!==null&&r.memoizedState.isDehydrated)try{co(n.containerInfo)}catch(he){Pe(e,e.return,he)}id&&(id=!1,Mg(e));break;case 4:s=vn,vn=cl(e.stateNode.containerInfo),Rt(n,e),Ot(e),vn=s;break;case 12:Rt(n,e),Ot(e);break;case 31:Rt(n,e),Ot(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Gi(e,s)));break;case 13:Rt(n,e),Ot(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Zi=Oe()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Gi(e,s)));break;case 22:d=e.memoizedState!==null;var z=r!==null&&r.memoizedState!==null,Y=Zn,te=lt;if(Zn=Y||d,lt=te||z,Rt(n,e),lt=te,Zn=Y,Ot(e),s&8192)e:for(n=e.stateNode,n._visibility=d?n._visibility&-2:n._visibility|1,d&&(r===null||z||Zn||lt||pr(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{A=z.stateNode;var se=z.memoizedProps.style,G=se!=null&&se.hasOwnProperty("display")?se.display:null;A.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(he){Pe(z,z.return,he)}}}else if(n.tag===6){if(r===null){z=n;try{z.stateNode.nodeValue=d?"":z.memoizedProps}catch(he){Pe(z,z.return,he)}}}else if(n.tag===18){if(r===null){z=n;try{var Q=z.stateNode;d?Sv(Q,!0):Sv(z.stateNode,!1)}catch(he){Pe(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,Gi(e,r))));break;case 19:Rt(n,e),Ot(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Gi(e,s)));break;case 30:break;case 21:break;default:Rt(n,e),Ot(e)}}function Ot(e){var n=e.flags;if(n&2){try{for(var r,s=e.return;s!==null;){if(Cg(s)){r=s;break}s=s.return}if(r==null)throw Error(i(160));switch(r.tag){case 27:var d=r.stateNode,h=od(e);$i(e,h,d);break;case 5:var x=r.stateNode;r.flags&32&&(Or(x,""),r.flags&=-33);var A=od(e);$i(e,A,x);break;case 3:case 4:var z=r.stateNode.containerInfo,Y=od(e);sd(e,Y,z);break;default:throw Error(i(161))}}catch(te){Pe(e,e.return,te)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Mg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Mg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Jn(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)jg(e,n.alternate,n),n=n.sibling}function pr(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:ka(4,n,n.return),pr(n);break;case 1:An(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&Sg(n,n.return,r),pr(n);break;case 27:Ss(n.stateNode);case 26:case 5:An(n,n.return),pr(n);break;case 22:n.memoizedState===null&&pr(n);break;case 30:pr(n);break;default:pr(n)}e=e.sibling}}function ea(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:ea(d,h,r),ms(4,h);break;case 1:if(ea(d,h,r),s=h,d=s.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(Y){Pe(s,s.return,Y)}if(s=h,d=s.updateQueue,d!==null){var A=s.stateNode;try{var z=d.shared.hiddenCallbacks;if(z!==null)for(d.shared.hiddenCallbacks=null,d=0;d<z.length;d++)dh(z[d],A)}catch(Y){Pe(s,s.return,Y)}}r&&x&64&&kg(h),ps(h,h.return);break;case 27:Tg(h);case 26:case 5:ea(d,h,r),r&&s===null&&x&4&&Eg(h),ps(h,h.return);break;case 12:ea(d,h,r);break;case 31:ea(d,h,r),r&&x&4&&Rg(d,h);break;case 13:ea(d,h,r),r&&x&4&&Og(d,h);break;case 22:h.memoizedState===null&&ea(d,h,r),ps(h,h.return);break;case 30:break;default:ea(d,h,r)}n=n.sibling}}function ld(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&&es(r))}function cd(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&es(e))}function yn(e,n,r,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Lg(e,n,r,s),n=n.sibling}function Lg(e,n,r,s){var d=n.flags;switch(n.tag){case 0:case 11:case 15:yn(e,n,r,s),d&2048&&ms(9,n);break;case 1:yn(e,n,r,s);break;case 3:yn(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&&es(e)));break;case 12:if(d&2048){yn(e,n,r,s),e=n.stateNode;try{var h=n.memoizedProps,x=h.id,A=h.onPostCommit;typeof A=="function"&&A(x,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(z){Pe(n,n.return,z)}}else yn(e,n,r,s);break;case 31:yn(e,n,r,s);break;case 13:yn(e,n,r,s);break;case 23:break;case 22:h=n.stateNode,x=n.alternate,n.memoizedState!==null?h._visibility&2?yn(e,n,r,s):hs(e,n):h._visibility&2?yn(e,n,r,s):(h._visibility|=2,Qr(e,n,r,s,(n.subtreeFlags&10256)!==0||!1)),d&2048&&ld(x,n);break;case 24:yn(e,n,r,s),d&2048&&cd(n.alternate,n);break;default:yn(e,n,r,s)}}function Qr(e,n,r,s,d){for(d=d&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,x=n,A=r,z=s,Y=x.flags;switch(x.tag){case 0:case 11:case 15:Qr(h,x,A,z,d),ms(8,x);break;case 23:break;case 22:var te=x.stateNode;x.memoizedState!==null?te._visibility&2?Qr(h,x,A,z,d):hs(h,x):(te._visibility|=2,Qr(h,x,A,z,d)),d&&Y&2048&&ld(x.alternate,x);break;case 24:Qr(h,x,A,z,d),d&&Y&2048&&cd(x.alternate,x);break;default:Qr(h,x,A,z,d)}n=n.sibling}}function hs(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:hs(r,s),d&2048&&ld(s.alternate,s);break;case 24:hs(r,s),d&2048&&cd(s.alternate,s);break;default:hs(r,s)}n=n.sibling}}var gs=8192;function Jr(e,n,r){if(e.subtreeFlags&gs)for(e=e.child;e!==null;)zg(e,n,r),e=e.sibling}function zg(e,n,r){switch(e.tag){case 26:Jr(e,n,r),e.flags&gs&&e.memoizedState!==null&&E2(r,vn,e.memoizedState,e.memoizedProps);break;case 5:Jr(e,n,r);break;case 3:case 4:var s=vn;vn=cl(e.stateNode.containerInfo),Jr(e,n,r),vn=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=gs,gs=16777216,Jr(e,n,r),gs=s):Jr(e,n,r));break;default:Jr(e,n,r)}}function Hg(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 vs(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];dt=s,Ug(s,e)}Hg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Bg(e),e=e.sibling}function Bg(e){switch(e.tag){case 0:case 11:case 15:vs(e),e.flags&2048&&ka(9,e,e.return);break;case 3:vs(e);break;case 12:vs(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Xi(e)):vs(e);break;default:vs(e)}}function Xi(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];dt=s,Ug(s,e)}Hg(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:ka(8,n,n.return),Xi(n);break;case 22:r=n.stateNode,r._visibility&2&&(r._visibility&=-3,Xi(n));break;default:Xi(n)}e=e.sibling}}function Ug(e,n){for(;dt!==null;){var r=dt;switch(r.tag){case 0:case 11:case 15:ka(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:es(r.memoizedState.cache)}if(s=r.child,s!==null)s.return=r,dt=s;else e:for(r=e;dt!==null;){s=dt;var d=s.sibling,h=s.return;if(Ag(s),s===r){dt=null;break e}if(d!==null){d.return=h,dt=d;break e}dt=h}}}var Uk={getCacheForType:function(e){var n=ht(ot),r=n.data.get(e);return r===void 0&&(r=e(),n.data.set(e,r)),r},cacheSignal:function(){return ht(ot).controller.signal}},Wk=typeof WeakMap=="function"?WeakMap:Map,Ie=0,Ve=null,De=null,Le=0,qe=0,Vt=null,Sa=!1,eo=!1,ud=!1,ta=0,et=0,Ea=0,hr=0,dd=0,$t=0,to=0,ys=null,Dt=null,fd=!1,Zi=0,Wg=0,Qi=1/0,Ji=null,Ca=null,ct=0,Ta=null,no=null,na=0,md=0,pd=null,Ig=null,bs=0,hd=null;function Gt(){return(Ie&2)!==0&&Le!==0?Le&-Le:D.T!==null?xd():ap()}function qg(){if($t===0)if((Le&536870912)===0||He){var e=ii;ii<<=1,(ii&3932160)===0&&(ii=262144),$t=e}else $t=536870912;return e=Kt.current,e!==null&&(e.flags|=32),$t}function Mt(e,n,r){(e===Ve&&(qe===2||qe===9)||e.cancelPendingCommit!==null)&&(ao(e,0),Na(e,Le,$t,!1)),Wo(e,r),((Ie&2)===0||e!==Ve)&&(e===Ve&&((Ie&2)===0&&(hr|=r),et===4&&Na(e,Le,$t,!1)),_n(e))}function Pg(e,n,r){if((Ie&6)!==0)throw Error(i(327));var s=!r&&(n&127)===0&&(n&e.expiredLanes)===0||Uo(e,n),d=s?Pk(e,n):vd(e,n,!0),h=s;do{if(d===0){eo&&!s&&Na(e,n,0,!1);break}else{if(r=e.current.alternate,h&&!Ik(r)){d=vd(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 A=e;d=ys;var z=A.current.memoizedState.isDehydrated;if(z&&(ao(A,x).flags|=256),x=vd(A,x,!1),x!==2){if(ud&&!z){A.errorRecoveryDisabledLanes|=h,hr|=h,d=4;break e}h=Dt,Dt=d,h!==null&&(Dt===null?Dt=h:Dt.push.apply(Dt,h))}d=x}if(h=!1,d!==2)continue}}if(d===1){ao(e,0),Na(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:Na(s,n,$t,!Sa);break e;case 2:Dt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((n&62914560)===n&&(d=Zi+300-Oe(),10<d)){if(Na(s,n,$t,!Sa),ci(s,0,!0)!==0)break e;na=n,s.timeoutHandle=wv(Fg.bind(null,s,r,Dt,Ji,fd,n,$t,hr,to,Sa,h,"Throttled",-0,0),d);break e}Fg(s,r,Dt,Ji,fd,n,$t,hr,to,Sa,h,null,-0,0)}}break}while(!0);_n(e)}function Fg(e,n,r,s,d,h,x,A,z,Y,te,se,G,Q){if(e.timeoutHandle=-1,se=n.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:In},zg(n,h,se);var he=(h&62914560)===h?Zi-Oe():(h&4194048)===h?Wg-Oe():0;if(he=C2(se,he),he!==null){na=h,e.cancelPendingCommit=he(Qg.bind(null,e,n,h,r,s,d,x,A,z,te,se,null,G,Q)),Na(e,h,x,!Y);return}}Qg(e,n,h,r,s,d,x,A,z)}function Ik(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(!Pt(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 Na(e,n,r,s){n&=~dd,n&=~hr,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var d=n;0<d;){var h=31-qt(d),x=1<<h;s[h]=-1,d&=~x}r!==0&&ep(e,r,n)}function el(){return(Ie&6)===0?(ws(0),!1):!0}function gd(){if(De!==null){if(qe===0)var e=De.return;else e=De,Kn=sr=null,Ou(e),Vr=null,ns=0,e=De;for(;e!==null;)xg(e.alternate,e),e=e.return;De=null}}function ao(e,n){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,i2(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),na=0,gd(),Ve=e,De=r=Pn(e.current,null),Le=n,qe=0,Vt=null,Sa=!1,eo=Uo(e,n),ud=!1,to=$t=dd=hr=Ea=et=0,Dt=ys=null,fd=!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-qt(s),h=1<<d;n|=e[d],s&=~h}return ta=n,xi(),r}function Kg(e,n){_e=null,D.H=us,n===Yr||n===Ai?(n=ih(),qe=3):n===wu?(n=ih(),qe=4):qe=n===$u?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Vt=n,De===null&&(et=1,Pi(e,on(n,e.current)))}function Yg(){var e=Kt.current;return e===null?!0:(Le&4194048)===Le?un===null:(Le&62914560)===Le||(Le&536870912)!==0?e===un:!1}function Vg(){var e=D.H;return D.H=us,e===null?us:e}function $g(){var e=D.A;return D.A=Uk,e}function tl(){et=4,Sa||(Le&4194048)!==Le&&Kt.current!==null||(eo=!0),(Ea&134217727)===0&&(hr&134217727)===0||Ve===null||Na(Ve,Le,$t,!1)}function vd(e,n,r){var s=Ie;Ie|=2;var d=Vg(),h=$g();(Ve!==e||Le!==n)&&(Ji=null,ao(e,n)),n=!1;var x=et;e:do try{if(qe!==0&&De!==null){var A=De,z=Vt;switch(qe){case 8:gd(),x=6;break e;case 3:case 2:case 9:case 6:Kt.current===null&&(n=!0);var Y=qe;if(qe=0,Vt=null,ro(e,A,z,Y),r&&eo){x=0;break e}break;default:Y=qe,qe=0,Vt=null,ro(e,A,z,Y)}}qk(),x=et;break}catch(te){Kg(e,te)}while(!0);return n&&e.shellSuspendCounter++,Kn=sr=null,Ie=s,D.H=d,D.A=h,De===null&&(Ve=null,Le=0,xi()),x}function qk(){for(;De!==null;)Gg(De)}function Pk(e,n){var r=Ie;Ie|=2;var s=Vg(),d=$g();Ve!==e||Le!==n?(Ji=null,Qi=Oe()+500,ao(e,n)):eo=Uo(e,n);e:do try{if(qe!==0&&De!==null){n=De;var h=Vt;t:switch(qe){case 1:qe=0,Vt=null,ro(e,n,h,1);break;case 2:case 9:if(oh(h)){qe=0,Vt=null,Xg(n);break}n=function(){qe!==2&&qe!==9||Ve!==e||(qe=7),_n(e)},h.then(n,n);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:oh(h)?(qe=0,Vt=null,Xg(n)):(qe=0,Vt=null,ro(e,n,h,7));break;case 5:var x=null;switch(De.tag){case 26:x=De.memoizedState;case 5:case 27:var A=De;if(x?Lv(x):A.stateNode.complete){qe=0,Vt=null;var z=A.sibling;if(z!==null)De=z;else{var Y=A.return;Y!==null?(De=Y,nl(Y)):De=null}break t}}qe=0,Vt=null,ro(e,n,h,5);break;case 6:qe=0,Vt=null,ro(e,n,h,6);break;case 8:gd(),et=6;break e;default:throw Error(i(462))}}Fk();break}catch(te){Kg(e,te)}while(!0);return Kn=sr=null,D.H=s,D.A=d,Ie=r,De!==null?0:(Ve=null,Le=0,xi(),et)}function Fk(){for(;De!==null&&!ke();)Gg(De)}function Gg(e){var n=bg(e.alternate,e,ta);e.memoizedProps=e.pendingProps,n===null?nl(e):De=n}function Xg(e){var n=e,r=n.alternate;switch(n.tag){case 15:case 0:n=mg(r,n,n.pendingProps,n.type,void 0,Le);break;case 11:n=mg(r,n,n.pendingProps,n.type.render,n.ref,Le);break;case 5:Ou(n);default:xg(r,n),n=De=$p(n,ta),n=bg(r,n,ta)}e.memoizedProps=e.pendingProps,n===null?nl(e):De=n}function ro(e,n,r,s){Kn=sr=null,Ou(n),Vr=null,ns=0;var d=n.return;try{if(Ok(e,d,n,r,Le)){et=1,Pi(e,on(r,e.current)),De=null;return}}catch(h){if(d!==null)throw De=d,h;et=1,Pi(e,on(r,e.current)),De=null;return}n.flags&32768?(He||s===1?e=!0:eo||(Le&536870912)!==0?e=!1:(Sa=e=!0,(s===2||s===9||s===3||s===6)&&(s=Kt.current,s!==null&&s.tag===13&&(s.flags|=16384))),Zg(n,e)):nl(n)}function nl(e){var n=e;do{if((n.flags&32768)!==0){Zg(n,Sa);return}e=n.return;var r=Lk(n.alternate,n,ta);if(r!==null){De=r;return}if(n=n.sibling,n!==null){De=n;return}De=n=e}while(n!==null);et===0&&(et=5)}function Zg(e,n){do{var r=zk(e.alternate,e);if(r!==null){r.flags&=32767,De=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!n&&(e=e.sibling,e!==null)){De=e;return}De=e=r}while(e!==null);et=6,De=null}function Qg(e,n,r,s,d,h,x,A,z){e.cancelPendingCommit=null;do al();while(ct!==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|=ou,S1(e,r,h,x,A,z),e===Ve&&(De=Ve=null,Le=0),no=n,Ta=e,na=r,md=h,pd=d,Ig=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,$k(Be,function(){return av(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=D.T,D.T=null,d=P.p,P.p=2,x=Ie,Ie|=4;try{Hk(e,n,r)}finally{Ie=x,P.p=d,D.T=s}}ct=1,Jg(),ev(),tv()}}function Jg(){if(ct===1){ct=0;var e=Ta,n=no,r=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||r){r=D.T,D.T=null;var s=P.p;P.p=2;var d=Ie;Ie|=4;try{Dg(n,e);var h=Ad,x=Up(e.containerInfo),A=h.focusedElem,z=h.selectionRange;if(x!==A&&A&&A.ownerDocument&&Bp(A.ownerDocument.documentElement,A)){if(z!==null&&eu(A)){var Y=z.start,te=z.end;if(te===void 0&&(te=Y),"selectionStart"in A)A.selectionStart=Y,A.selectionEnd=Math.min(te,A.value.length);else{var se=A.ownerDocument||document,G=se&&se.defaultView||window;if(G.getSelection){var Q=G.getSelection(),he=A.textContent.length,Ce=Math.min(z.start,he),Ye=z.end===void 0?Ce:Math.min(z.end,he);!Q.extend&&Ce>Ye&&(x=Ye,Ye=Ce,Ce=x);var W=Hp(A,Ce),H=Hp(A,Ye);if(W&&H&&(Q.rangeCount!==1||Q.anchorNode!==W.node||Q.anchorOffset!==W.offset||Q.focusNode!==H.node||Q.focusOffset!==H.offset)){var K=se.createRange();K.setStart(W.node,W.offset),Q.removeAllRanges(),Ce>Ye?(Q.addRange(K),Q.extend(H.node,H.offset)):(K.setEnd(H.node,H.offset),Q.addRange(K))}}}}for(se=[],Q=A;Q=Q.parentNode;)Q.nodeType===1&&se.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<se.length;A++){var oe=se[A];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}hl=!!jd,Ad=jd=null}finally{Ie=d,P.p=s,D.T=r}}e.current=n,ct=2}}function ev(){if(ct===2){ct=0;var e=Ta,n=no,r=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||r){r=D.T,D.T=null;var s=P.p;P.p=2;var d=Ie;Ie|=4;try{jg(e,n.alternate,n)}finally{Ie=d,P.p=s,D.T=r}}ct=3}}function tv(){if(ct===4||ct===3){ct=0,pe();var e=Ta,n=no,r=na,s=Ig;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?ct=5:(ct=0,no=Ta=null,nv(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Ca=null),Lc(r),n=n.stateNode,It&&typeof It.onCommitFiberRoot=="function")try{It.onCommitFiberRoot(Bo,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=D.T,d=P.p,P.p=2,D.T=null;try{for(var h=e.onRecoverableError,x=0;x<s.length;x++){var A=s[x];h(A.value,{componentStack:A.stack})}}finally{D.T=n,P.p=d}}(na&3)!==0&&al(),_n(e),d=e.pendingLanes,(r&261930)!==0&&(d&42)!==0?e===hd?bs++:(bs=0,hd=e):bs=0,ws(0)}}function nv(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,es(n)))}function al(){return Jg(),ev(),tv(),av()}function av(){if(ct!==5)return!1;var e=Ta,n=md;md=0;var r=Lc(na),s=D.T,d=P.p;try{P.p=32>r?32:r,D.T=null,r=pd,pd=null;var h=Ta,x=na;if(ct=0,no=Ta=null,na=0,(Ie&6)!==0)throw Error(i(331));var A=Ie;if(Ie|=4,Bg(h.current),Lg(h,h.current,x,r),Ie=A,ws(0,!1),It&&typeof It.onPostCommitFiberRoot=="function")try{It.onPostCommitFiberRoot(Bo,h)}catch{}return!0}finally{P.p=d,D.T=s,nv(e,n)}}function rv(e,n,r){n=on(r,n),n=Vu(e.stateNode,n,2),e=ba(e,n,2),e!==null&&(Wo(e,2),_n(e))}function Pe(e,n,r){if(e.tag===3)rv(e,e,r);else for(;n!==null;){if(n.tag===3){rv(n,e,r);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Ca===null||!Ca.has(s))){e=on(r,e),r=og(2),s=ba(n,r,2),s!==null&&(sg(r,s,n,e),Wo(s,2),_n(s));break}}n=n.return}}function yd(e,n,r){var s=e.pingCache;if(s===null){s=e.pingCache=new Wk;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)||(ud=!0,d.add(r),e=Kk.bind(null,e,n,r),n.then(e,e))}function Kk(e,n,r){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,Ve===e&&(Le&r)===r&&(et===4||et===3&&(Le&62914560)===Le&&300>Oe()-Zi?(Ie&2)===0&&ao(e,0):dd|=r,to===Le&&(to=0)),_n(e)}function ov(e,n){n===0&&(n=Jm()),e=ar(e,n),e!==null&&(Wo(e,n),_n(e))}function Yk(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),ov(e,r)}function Vk(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),ov(e,r)}function $k(e,n){return Tn(e,n)}var rl=null,oo=null,bd=!1,ol=!1,wd=!1,ja=0;function _n(e){e!==oo&&e.next===null&&(oo===null?rl=oo=e:oo=oo.next=e),ol=!0,bd||(bd=!0,Xk())}function ws(e,n){if(!wd&&ol){wd=!0;do for(var r=!1,s=rl;s!==null;){if(e!==0){var d=s.pendingLanes;if(d===0)var h=0;else{var x=s.suspendedLanes,A=s.pingedLanes;h=(1<<31-qt(42|e)+1)-1,h&=d&~(x&~A),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,cv(s,h))}else h=Le,h=ci(s,s===Ve?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(h&3)===0||Uo(s,h)||(r=!0,cv(s,h));s=s.next}while(r);wd=!1}}function Gk(){sv()}function sv(){ol=bd=!1;var e=0;ja!==0&&s2()&&(e=ja);for(var n=Oe(),r=null,s=rl;s!==null;){var d=s.next,h=iv(s,n);h===0?(s.next=null,r===null?rl=d:r.next=d,d===null&&(oo=r)):(r=s,(e!==0||(h&3)!==0)&&(ol=!0)),s=d}ct!==0&&ct!==5||ws(e),ja!==0&&(ja=0)}function iv(e,n){for(var r=e.suspendedLanes,s=e.pingedLanes,d=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var x=31-qt(h),A=1<<x,z=d[x];z===-1?((A&r)===0||(A&s)!==0)&&(d[x]=k1(A,n)):z<=n&&(e.expiredLanes|=A),h&=~A}if(n=Ve,r=Le,r=ci(e,e===n?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,r===0||e===n&&(qe===2||qe===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&tn(s),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||Uo(e,r)){if(n=r&-r,n===e.callbackPriority)return n;switch(s!==null&&tn(s),Lc(r)){case 2:case 8:r=Ee;break;case 32:r=Be;break;case 268435456:r=Za;break;default:r=Be}return s=lv.bind(null,e),r=Tn(r,s),e.callbackPriority=n,e.callbackNode=r,n}return s!==null&&s!==null&&tn(s),e.callbackPriority=2,e.callbackNode=null,2}function lv(e,n){if(ct!==0&&ct!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(al()&&e.callbackNode!==r)return null;var s=Le;return s=ci(e,e===Ve?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Pg(e,s,n),iv(e,Oe()),e.callbackNode!=null&&e.callbackNode===r?lv.bind(null,e):null)}function cv(e,n){if(al())return null;Pg(e,n,!0)}function Xk(){l2(function(){(Ie&6)!==0?Tn(Ho,Gk):sv()})}function xd(){if(ja===0){var e=Fr;e===0&&(e=si,si<<=1,(si&261888)===0&&(si=256)),ja=e}return ja}function uv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:mi(""+e)}function dv(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 Zk(e,n,r,s,d){if(n==="submit"&&r&&r.stateNode===d){var h=uv((d[jt]||null).action),x=s.submitter;x&&(n=(n=x[jt]||null)?uv(n.formAction):x.getAttribute("formAction"),n!==null&&(h=n,x=null));var A=new vi("action","action",null,s,d);e.push({event:A,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(ja!==0){var z=x?dv(d,x):new FormData(d);Iu(r,{pending:!0,data:z,method:d.method,action:h},null,z)}}else typeof h=="function"&&(A.preventDefault(),z=x?dv(d,x):new FormData(d),Iu(r,{pending:!0,data:z,method:d.method,action:h},h,z))},currentTarget:d}]})}}for(var kd=0;kd<ru.length;kd++){var Sd=ru[kd],Qk=Sd.toLowerCase(),Jk=Sd[0].toUpperCase()+Sd.slice(1);gn(Qk,"on"+Jk)}gn(qp,"onAnimationEnd"),gn(Pp,"onAnimationIteration"),gn(Fp,"onAnimationStart"),gn("dblclick","onDoubleClick"),gn("focusin","onFocus"),gn("focusout","onBlur"),gn(hk,"onTransitionRun"),gn(gk,"onTransitionStart"),gn(vk,"onTransitionCancel"),gn(Kp,"onTransitionEnd"),_r("onMouseEnter",["mouseout","mouseover"]),_r("onMouseLeave",["mouseout","mouseover"]),_r("onPointerEnter",["pointerout","pointerover"]),_r("onPointerLeave",["pointerout","pointerover"]),Ja("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ja("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ja("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ja("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ja("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ja("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xs="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(" "),e2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xs));function fv(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 A=s[x],z=A.instance,Y=A.currentTarget;if(A=A.listener,z!==h&&d.isPropagationStopped())break e;h=A,d.currentTarget=Y;try{h(d)}catch(te){wi(te)}d.currentTarget=null,h=z}else for(x=0;x<s.length;x++){if(A=s[x],z=A.instance,Y=A.currentTarget,A=A.listener,z!==h&&d.isPropagationStopped())break e;h=A,d.currentTarget=Y;try{h(d)}catch(te){wi(te)}d.currentTarget=null,h=z}}}}function Me(e,n){var r=n[zc];r===void 0&&(r=n[zc]=new Set);var s=e+"__bubble";r.has(s)||(mv(n,e,2,!1),r.add(s))}function Ed(e,n,r){var s=0;n&&(s|=4),mv(r,e,s,n)}var sl="_reactListening"+Math.random().toString(36).slice(2);function Cd(e){if(!e[sl]){e[sl]=!0,sp.forEach(function(r){r!=="selectionchange"&&(e2.has(r)||Ed(r,!1,e),Ed(r,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[sl]||(n[sl]=!0,Ed("selectionchange",!1,n))}}function mv(e,n,r,s){switch(qv(n)){case 2:var d=j2;break;case 8:d=A2;break;default:d=Wd}r=d.bind(null,n,r,e),d=void 0,!Kc||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 Td(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 A=s.stateNode.containerInfo;if(A===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(;A!==null;){if(x=Nr(A),x===null)return;if(z=x.tag,z===5||z===6||z===26||z===27){s=h=x;continue e}A=A.parentNode}}s=s.return}yp(function(){var Y=h,te=Pc(r),se=[];e:{var G=Yp.get(e);if(G!==void 0){var Q=vi,he=e;switch(e){case"keypress":if(hi(r)===0)break e;case"keydown":case"keyup":Q=V1;break;case"focusin":he="focus",Q=Gc;break;case"focusout":he="blur",Q=Gc;break;case"beforeblur":case"afterblur":Q=Gc;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":Q=xp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=L1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=X1;break;case qp:case Pp:case Fp:Q=B1;break;case Kp:Q=Q1;break;case"scroll":case"scrollend":Q=D1;break;case"wheel":Q=ek;break;case"copy":case"cut":case"paste":Q=W1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=Sp;break;case"toggle":case"beforetoggle":Q=nk}var Ce=(n&4)!==0,Ye=!Ce&&(e==="scroll"||e==="scrollend"),W=Ce?G!==null?G+"Capture":null:G;Ce=[];for(var H=Y,K;H!==null;){var oe=H;if(K=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||K===null||W===null||(oe=Po(H,W),oe!=null&&Ce.push(ks(H,oe,K))),Ye)break;H=H.return}0<Ce.length&&(G=new Q(G,he,null,r,te),se.push({event:G,listeners:Ce}))}}if((n&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",Q=e==="mouseout"||e==="pointerout",G&&r!==qc&&(he=r.relatedTarget||r.fromElement)&&(Nr(he)||he[Tr]))break e;if((Q||G)&&(G=te.window===te?te:(G=te.ownerDocument)?G.defaultView||G.parentWindow:window,Q?(he=r.relatedTarget||r.toElement,Q=Y,he=he?Nr(he):null,he!==null&&(Ye=u(he),Ce=he.tag,he!==Ye||Ce!==5&&Ce!==27&&Ce!==6)&&(he=null)):(Q=null,he=Y),Q!==he)){if(Ce=xp,oe="onMouseLeave",W="onMouseEnter",H="mouse",(e==="pointerout"||e==="pointerover")&&(Ce=Sp,oe="onPointerLeave",W="onPointerEnter",H="pointer"),Ye=Q==null?G:qo(Q),K=he==null?G:qo(he),G=new Ce(oe,H+"leave",Q,r,te),G.target=Ye,G.relatedTarget=K,oe=null,Nr(te)===Y&&(Ce=new Ce(W,H+"enter",he,r,te),Ce.target=K,Ce.relatedTarget=Ye,oe=Ce),Ye=oe,Q&&he)t:{for(Ce=t2,W=Q,H=he,K=0,oe=W;oe;oe=Ce(oe))K++;oe=0;for(var xe=H;xe;xe=Ce(xe))oe++;for(;0<K-oe;)W=Ce(W),K--;for(;0<oe-K;)H=Ce(H),oe--;for(;K--;){if(W===H||H!==null&&W===H.alternate){Ce=W;break t}W=Ce(W),H=Ce(H)}Ce=null}else Ce=null;Q!==null&&pv(se,G,Q,Ce,!1),he!==null&&Ye!==null&&pv(se,Ye,he,Ce,!0)}}e:{if(G=Y?qo(Y):window,Q=G.nodeName&&G.nodeName.toLowerCase(),Q==="select"||Q==="input"&&G.type==="file")var Ue=Rp;else if(Ap(G))if(Op)Ue=fk;else{Ue=uk;var be=ck}else Q=G.nodeName,!Q||Q.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?Y&&Ic(Y.elementType)&&(Ue=Rp):Ue=dk;if(Ue&&(Ue=Ue(e,Y))){_p(se,Ue,r,te);break e}be&&be(e,G,Y),e==="focusout"&&Y&&G.type==="number"&&Y.memoizedProps.value!=null&&Wc(G,"number",G.value)}switch(be=Y?qo(Y):window,e){case"focusin":(Ap(be)||be.contentEditable==="true")&&(zr=be,tu=Y,Zo=null);break;case"focusout":Zo=tu=zr=null;break;case"mousedown":nu=!0;break;case"contextmenu":case"mouseup":case"dragend":nu=!1,Wp(se,r,te);break;case"selectionchange":if(pk)break;case"keydown":case"keyup":Wp(se,r,te)}var Re;if(Zc)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Lr?Np(e,r)&&(ze="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(ze="onCompositionStart");ze&&(Ep&&r.locale!=="ko"&&(Lr||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Lr&&(Re=bp()):(fa=te,Yc="value"in fa?fa.value:fa.textContent,Lr=!0)),be=il(Y,ze),0<be.length&&(ze=new kp(ze,e,null,r,te),se.push({event:ze,listeners:be}),Re?ze.data=Re:(Re=jp(r),Re!==null&&(ze.data=Re)))),(Re=rk?ok(e,r):sk(e,r))&&(ze=il(Y,"onBeforeInput"),0<ze.length&&(be=new kp("onBeforeInput","beforeinput",null,r,te),se.push({event:be,listeners:ze}),be.data=Re)),Zk(se,e,Y,r,te)}fv(se,n)})}function ks(e,n,r){return{instance:e,listener:n,currentTarget:r}}function il(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=Po(e,r),d!=null&&s.unshift(ks(e,d,h)),d=Po(e,n),d!=null&&s.push(ks(e,d,h))),e.tag===3)return s;e=e.return}return[]}function t2(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function pv(e,n,r,s,d){for(var h=n._reactName,x=[];r!==null&&r!==s;){var A=r,z=A.alternate,Y=A.stateNode;if(A=A.tag,z!==null&&z===s)break;A!==5&&A!==26&&A!==27||Y===null||(z=Y,d?(Y=Po(r,h),Y!=null&&x.unshift(ks(r,Y,z))):d||(Y=Po(r,h),Y!=null&&x.push(ks(r,Y,z)))),r=r.return}x.length!==0&&e.push({event:n,listeners:x})}var n2=/\r\n?/g,a2=/\u0000|\uFFFD/g;function hv(e){return(typeof e=="string"?e:""+e).replace(n2,`
|
|
10
|
+
`).replace(a2,"")}function gv(e,n){return n=hv(n),hv(e)===n}function Ke(e,n,r,s,d,h){switch(r){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||Or(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&Or(e,""+s);break;case"className":di(e,"class",s);break;case"tabIndex":di(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":di(e,r,s);break;case"style":gp(e,s,h);break;case"data":if(n!=="object"){di(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=mi(""+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"&&Ke(e,n,"name",d.name,d,null),Ke(e,n,"formEncType",d.formEncType,d,null),Ke(e,n,"formMethod",d.formMethod,d,null),Ke(e,n,"formTarget",d.formTarget,d,null)):(Ke(e,n,"encType",d.encType,d,null),Ke(e,n,"method",d.method,d,null),Ke(e,n,"target",d.target,d,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(r);break}s=mi(""+s),e.setAttribute(r,s);break;case"onClick":s!=null&&(e.onclick=In);break;case"onScroll":s!=null&&Me("scroll",e);break;case"onScrollEnd":s!=null&&Me("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=mi(""+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":Me("beforetoggle",e),Me("toggle",e),ui(e,"popover",s);break;case"xlinkActuate":Wn(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Wn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Wn(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Wn(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Wn(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Wn(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":ui(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=R1.get(r)||r,ui(e,r,s))}}function Nd(e,n,r,s,d,h){switch(r){case"style":gp(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"?Or(e,s):(typeof s=="number"||typeof s=="bigint")&&Or(e,""+s);break;case"onScroll":s!=null&&Me("scroll",e);break;case"onScrollEnd":s!=null&&Me("scrollend",e);break;case"onClick":s!=null&&(e.onclick=In);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ip.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[jt]||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,""):ui(e,r,s)}}}function vt(e,n,r){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Me("error",e),Me("load",e);var 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:Ke(e,n,h,x,r,null)}}d&&Ke(e,n,"srcSet",r.srcSet,r,null),s&&Ke(e,n,"src",r.src,r,null);return;case"input":Me("invalid",e);var A=h=x=d=null,z=null,Y=null;for(s in r)if(r.hasOwnProperty(s)){var te=r[s];if(te!=null)switch(s){case"name":d=te;break;case"type":x=te;break;case"checked":z=te;break;case"defaultChecked":Y=te;break;case"value":h=te;break;case"defaultValue":A=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(i(137,n));break;default:Ke(e,n,s,te,r,null)}}fp(e,h,A,z,Y,x,d,!1);return;case"select":Me("invalid",e),s=x=h=null;for(d in r)if(r.hasOwnProperty(d)&&(A=r[d],A!=null))switch(d){case"value":h=A;break;case"defaultValue":x=A;break;case"multiple":s=A;default:Ke(e,n,d,A,r,null)}n=h,r=x,e.multiple=!!s,n!=null?Rr(e,!!s,n,!1):r!=null&&Rr(e,!!s,r,!0);return;case"textarea":Me("invalid",e),h=d=s=null;for(x in r)if(r.hasOwnProperty(x)&&(A=r[x],A!=null))switch(x){case"value":s=A;break;case"defaultValue":d=A;break;case"children":h=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(i(91));break;default:Ke(e,n,x,A,r,null)}pp(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":Ke(e,n,z,s,r,null));return;case"dialog":Me("beforetoggle",e),Me("toggle",e),Me("cancel",e),Me("close",e);break;case"iframe":case"object":Me("load",e);break;case"video":case"audio":for(s=0;s<xs.length;s++)Me(xs[s],e);break;case"image":Me("error",e),Me("load",e);break;case"details":Me("toggle",e);break;case"embed":case"source":case"link":Me("error",e),Me("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Y in r)if(r.hasOwnProperty(Y)&&(s=r[Y],s!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Ke(e,n,Y,s,r,null)}return;default:if(Ic(n)){for(te in r)r.hasOwnProperty(te)&&(s=r[te],s!==void 0&&Nd(e,n,te,s,r,void 0));return}}for(A in r)r.hasOwnProperty(A)&&(s=r[A],s!=null&&Ke(e,n,A,s,r,null))}function r2(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,A=null,z=null,Y=null,te=null;for(Q in r){var se=r[Q];if(r.hasOwnProperty(Q)&&se!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":z=se;default:s.hasOwnProperty(Q)||Ke(e,n,Q,null,s,se)}}for(var G in s){var Q=s[G];if(se=r[G],s.hasOwnProperty(G)&&(Q!=null||se!=null))switch(G){case"type":h=Q;break;case"name":d=Q;break;case"checked":Y=Q;break;case"defaultChecked":te=Q;break;case"value":x=Q;break;case"defaultValue":A=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(i(137,n));break;default:Q!==se&&Ke(e,n,G,Q,s,se)}}Uc(e,x,A,z,Y,te,h,d);return;case"select":Q=x=A=G=null;for(h in r)if(z=r[h],r.hasOwnProperty(h)&&z!=null)switch(h){case"value":break;case"multiple":Q=z;default:s.hasOwnProperty(h)||Ke(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":G=h;break;case"defaultValue":A=h;break;case"multiple":x=h;default:h!==z&&Ke(e,n,d,h,s,z)}n=A,r=x,s=Q,G!=null?Rr(e,!!r,G,!1):!!s!=!!r&&(n!=null?Rr(e,!!r,n,!0):Rr(e,!!r,r?[]:"",!1));return;case"textarea":Q=G=null;for(A in r)if(d=r[A],r.hasOwnProperty(A)&&d!=null&&!s.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:Ke(e,n,A,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":G=d;break;case"defaultValue":Q=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(i(91));break;default:d!==h&&Ke(e,n,x,d,s,h)}mp(e,G,Q);return;case"option":for(var he in r)G=r[he],r.hasOwnProperty(he)&&G!=null&&!s.hasOwnProperty(he)&&(he==="selected"?e.selected=!1:Ke(e,n,he,null,s,G));for(z in s)G=s[z],Q=r[z],s.hasOwnProperty(z)&&G!==Q&&(G!=null||Q!=null)&&(z==="selected"?e.selected=G&&typeof G!="function"&&typeof G!="symbol":Ke(e,n,z,G,s,Q));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)G=r[Ce],r.hasOwnProperty(Ce)&&G!=null&&!s.hasOwnProperty(Ce)&&Ke(e,n,Ce,null,s,G);for(Y in s)if(G=s[Y],Q=r[Y],s.hasOwnProperty(Y)&&G!==Q&&(G!=null||Q!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(i(137,n));break;default:Ke(e,n,Y,G,s,Q)}return;default:if(Ic(n)){for(var Ye in r)G=r[Ye],r.hasOwnProperty(Ye)&&G!==void 0&&!s.hasOwnProperty(Ye)&&Nd(e,n,Ye,void 0,s,G);for(te in s)G=s[te],Q=r[te],!s.hasOwnProperty(te)||G===Q||G===void 0&&Q===void 0||Nd(e,n,te,G,s,Q);return}}for(var W in r)G=r[W],r.hasOwnProperty(W)&&G!=null&&!s.hasOwnProperty(W)&&Ke(e,n,W,null,s,G);for(se in s)G=s[se],Q=r[se],!s.hasOwnProperty(se)||G===Q||G==null&&Q==null||Ke(e,n,se,G,s,Q)}function vv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function o2(){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,A=d.duration;if(h&&A&&vv(x)){for(x=0,A=d.responseEnd,s+=1;s<r.length;s++){var z=r[s],Y=z.startTime;if(Y>A)break;var te=z.transferSize,se=z.initiatorType;te&&vv(se)&&(z=z.responseEnd,x+=te*(z<A?1:(A-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 jd=null,Ad=null;function ll(e){return e.nodeType===9?e:e.ownerDocument}function yv(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 bv(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 _d(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 Rd=null;function s2(){var e=window.event;return e&&e.type==="popstate"?e===Rd?!1:(Rd=e,!0):(Rd=null,!1)}var wv=typeof setTimeout=="function"?setTimeout:void 0,i2=typeof clearTimeout=="function"?clearTimeout:void 0,xv=typeof Promise=="function"?Promise:void 0,l2=typeof queueMicrotask=="function"?queueMicrotask:typeof xv<"u"?function(e){return xv.resolve(null).then(e).catch(c2)}:wv;function c2(e){setTimeout(function(){throw e})}function Aa(e){return e==="head"}function kv(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),co(n);return}s--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")s++;else if(r==="html")Ss(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,Ss(r);for(var h=r.firstChild;h;){var x=h.nextSibling,A=h.nodeName;h[Io]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&h.rel.toLowerCase()==="stylesheet"||r.removeChild(h),h=x}}else r==="body"&&Ss(e.ownerDocument.body);r=d}while(r);co(n)}function Sv(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 Od(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":Od(r),Hc(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function u2(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[Io])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=dn(e.nextSibling),e===null)break}return null}function d2(e,n,r){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=dn(e.nextSibling),e===null))return null;return e}function Ev(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=dn(e.nextSibling),e===null))return null;return e}function Dd(e){return e.data==="$?"||e.data==="$~"}function Md(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function f2(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 dn(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 Ld=null;function Cv(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(n===0)return dn(e.nextSibling);n--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||n++}e=e.nextSibling}return null}function Tv(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 Nv(e,n,r){switch(n=ll(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 Ss(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Hc(e)}var fn=new Map,jv=new Set;function cl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var aa=P.d;P.d={f:m2,r:p2,D:h2,C:g2,L:v2,m:y2,X:w2,S:b2,M:x2};function m2(){var e=aa.f(),n=el();return e||n}function p2(e){var n=jr(e);n!==null&&n.tag===5&&n.type==="form"?Kh(n):aa.r(e)}var so=typeof document>"u"?null:document;function Av(e,n,r){var s=so;if(s&&typeof n=="string"&&n){var d=an(n);d='link[rel="'+e+'"][href="'+d+'"]',typeof r=="string"&&(d+='[crossorigin="'+r+'"]'),jv.has(d)||(jv.add(d),e={rel:e,crossOrigin:r,href:n},s.querySelector(d)===null&&(n=s.createElement("link"),vt(n,"link",e),ut(n),s.head.appendChild(n)))}}function h2(e){aa.D(e),Av("dns-prefetch",e,null)}function g2(e,n){aa.C(e,n),Av("preconnect",e,n)}function v2(e,n,r){aa.L(e,n,r);var s=so;if(s&&e&&n){var d='link[rel="preload"][as="'+an(n)+'"]';n==="image"&&r&&r.imageSrcSet?(d+='[imagesrcset="'+an(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(d+='[imagesizes="'+an(r.imageSizes)+'"]')):d+='[href="'+an(e)+'"]';var h=d;switch(n){case"style":h=io(e);break;case"script":h=lo(e)}fn.has(h)||(e=v({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:e,as:n},r),fn.set(h,e),s.querySelector(d)!==null||n==="style"&&s.querySelector(Es(h))||n==="script"&&s.querySelector(Cs(h))||(n=s.createElement("link"),vt(n,"link",e),ut(n),s.head.appendChild(n)))}}function y2(e,n){aa.m(e,n);var r=so;if(r&&e){var s=n&&typeof n.as=="string"?n.as:"script",d='link[rel="modulepreload"][as="'+an(s)+'"][href="'+an(e)+'"]',h=d;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=lo(e)}if(!fn.has(h)&&(e=v({rel:"modulepreload",href:e},n),fn.set(h,e),r.querySelector(d)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Cs(h)))return}s=r.createElement("link"),vt(s,"link",e),ut(s),r.head.appendChild(s)}}}function b2(e,n,r){aa.S(e,n,r);var s=so;if(s&&e){var d=Ar(s).hoistableStyles,h=io(e);n=n||"default";var x=d.get(h);if(!x){var A={loading:0,preload:null};if(x=s.querySelector(Es(h)))A.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":n},r),(r=fn.get(h))&&zd(e,r);var z=x=s.createElement("link");ut(z),vt(z,"link",e),z._p=new Promise(function(Y,te){z.onload=Y,z.onerror=te}),z.addEventListener("load",function(){A.loading|=1}),z.addEventListener("error",function(){A.loading|=2}),A.loading|=4,ul(x,n,s)}x={type:"stylesheet",instance:x,count:1,state:A},d.set(h,x)}}}function w2(e,n){aa.X(e,n);var r=so;if(r&&e){var s=Ar(r).hoistableScripts,d=lo(e),h=s.get(d);h||(h=r.querySelector(Cs(d)),h||(e=v({src:e,async:!0},n),(n=fn.get(d))&&Hd(e,n),h=r.createElement("script"),ut(h),vt(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},s.set(d,h))}}function x2(e,n){aa.M(e,n);var r=so;if(r&&e){var s=Ar(r).hoistableScripts,d=lo(e),h=s.get(d);h||(h=r.querySelector(Cs(d)),h||(e=v({src:e,async:!0,type:"module"},n),(n=fn.get(d))&&Hd(e,n),h=r.createElement("script"),ut(h),vt(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},s.set(d,h))}}function _v(e,n,r,s){var d=(d=fe.current)?cl(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=io(r.href),r=Ar(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=io(r.href);var h=Ar(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(Es(e)))&&!h._p&&(x.instance=h,x.state.loading=5),fn.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},fn.set(e,r),h||k2(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=lo(r),r=Ar(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 io(e){return'href="'+an(e)+'"'}function Es(e){return'link[rel="stylesheet"]['+e+"]"}function Rv(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function k2(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}),vt(n,"link",r),ut(n),e.head.appendChild(n))}function lo(e){return'[src="'+an(e)+'"]'}function Cs(e){return"script[async]"+e}function Ov(e,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+an(r.href)+'"]');if(s)return n.instance=s,ut(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"),ut(s),vt(s,"style",d),ul(s,r.precedence,e),n.instance=s;case"stylesheet":d=io(r.href);var h=e.querySelector(Es(d));if(h)return n.state.loading|=4,n.instance=h,ut(h),h;s=Rv(r),(d=fn.get(d))&&zd(s,d),h=(e.ownerDocument||e).createElement("link"),ut(h);var x=h;return x._p=new Promise(function(A,z){x.onload=A,x.onerror=z}),vt(h,"link",s),n.state.loading|=4,ul(h,r.precedence,e),n.instance=h;case"script":return h=lo(r.src),(d=e.querySelector(Cs(h)))?(n.instance=d,ut(d),d):(s=r,(d=fn.get(h))&&(s=v({},r),Hd(s,d)),e=e.ownerDocument||e,d=e.createElement("script"),ut(d),vt(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,ul(s,r.precedence,e));return n.instance}function ul(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 A=s[x];if(A.dataset.precedence===n)h=A;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 zd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Hd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var dl=null;function Dv(e,n,r){if(dl===null){var s=new Map,d=dl=new Map;d.set(r,s)}else d=dl,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[Io]||h[mt]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var x=h.getAttribute(n)||"";x=e+x;var A=s.get(x);A?A.push(h):s.set(x,[h])}}return s}function Mv(e,n,r){e=e.ownerDocument||e,e.head.insertBefore(r,n==="title"?e.querySelector("head > title"):null)}function S2(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 Lv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function E2(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=io(s.href),h=n.querySelector(Es(d));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=fl.bind(e),n.then(e,e)),r.state.loading|=4,r.instance=h,ut(h);return}h=n.ownerDocument||n,s=Rv(s),(d=fn.get(d))&&zd(s,d),h=h.createElement("link"),ut(h);var x=h;x._p=new Promise(function(A,z){x.onload=A,x.onerror=z}),vt(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=fl.bind(e),n.addEventListener("load",r),n.addEventListener("error",r))}}var Bd=0;function C2(e,n){return e.stylesheets&&e.count===0&&pl(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var s=setTimeout(function(){if(e.stylesheets&&pl(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&Bd===0&&(Bd=62500*o2());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&pl(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Bd?50:800)+n);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(d)}}:null}function fl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)pl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ml=null;function pl(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ml=new Map,n.forEach(T2,e),ml=null,fl.call(e))}function T2(e,n){if(!(n.state.loading&4)){var r=ml.get(e);if(r)var s=r.get(null);else{r=new Map,ml.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=fl.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 Ts={$$typeof:_,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function N2(e,n,r,s,d,h,x,A,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=Dc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dc(0),this.hiddenUpdates=Dc(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 zv(e,n,r,s,d,h,x,A,z,Y,te,se){return e=new N2(e,n,r,x,z,Y,te,se,A),n=1,h===!0&&(n|=24),h=Ft(3,null,null,n),e.current=h,h.stateNode=e,n=vu(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:s,isDehydrated:r,cache:n},xu(h),e}function Hv(e){return e?(e=Ur,e):Ur}function Bv(e,n,r,s,d,h){d=Hv(d),s.context===null?s.context=d:s.pendingContext=d,s=ya(n),s.payload={element:r},h=h===void 0?null:h,h!==null&&(s.callback=h),r=ba(e,s,n),r!==null&&(Mt(r,e,n),rs(r,e,n))}function Uv(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<n?r:n}}function Ud(e,n){Uv(e,n),(e=e.alternate)&&Uv(e,n)}function Wv(e){if(e.tag===13||e.tag===31){var n=ar(e,67108864);n!==null&&Mt(n,e,67108864),Ud(e,67108864)}}function Iv(e){if(e.tag===13||e.tag===31){var n=Gt();n=Mc(n);var r=ar(e,n);r!==null&&Mt(r,e,n),Ud(e,n)}}var hl=!0;function j2(e,n,r,s){var d=D.T;D.T=null;var h=P.p;try{P.p=2,Wd(e,n,r,s)}finally{P.p=h,D.T=d}}function A2(e,n,r,s){var d=D.T;D.T=null;var h=P.p;try{P.p=8,Wd(e,n,r,s)}finally{P.p=h,D.T=d}}function Wd(e,n,r,s){if(hl){var d=Id(s);if(d===null)Td(e,n,s,gl,r),Pv(e,s);else if(R2(d,e,n,r,s))s.stopPropagation();else if(Pv(e,s),n&4&&-1<_2.indexOf(e)){for(;d!==null;){var h=jr(d);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var x=Qa(h.pendingLanes);if(x!==0){var A=h;for(A.pendingLanes|=2,A.entangledLanes|=2;x;){var z=1<<31-qt(x);A.entanglements[1]|=z,x&=~z}_n(h),(Ie&6)===0&&(Qi=Oe()+500,ws(0))}}break;case 31:case 13:A=ar(h,2),A!==null&&Mt(A,h,2),el(),Ud(h,2)}if(h=Id(s),h===null&&Td(e,n,s,gl,r),h===d)break;d=h}d!==null&&s.stopPropagation()}else Td(e,n,s,null,r)}}function Id(e){return e=Pc(e),qd(e)}var gl=null;function qd(e){if(gl=null,e=Nr(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=m(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 gl=e,null}function qv(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Xa()){case Ho:return 2;case Ee:return 8;case Be:case ft:return 32;case Za:return 268435456;default:return 32}default:return 32}}var Pd=!1,_a=null,Ra=null,Oa=null,Ns=new Map,js=new Map,Da=[],_2="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 Pv(e,n){switch(e){case"focusin":case"focusout":_a=null;break;case"dragenter":case"dragleave":Ra=null;break;case"mouseover":case"mouseout":Oa=null;break;case"pointerover":case"pointerout":Ns.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":js.delete(n.pointerId)}}function As(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=jr(n),n!==null&&Wv(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),e)}function R2(e,n,r,s,d){switch(n){case"focusin":return _a=As(_a,e,n,r,s,d),!0;case"dragenter":return Ra=As(Ra,e,n,r,s,d),!0;case"mouseover":return Oa=As(Oa,e,n,r,s,d),!0;case"pointerover":var h=d.pointerId;return Ns.set(h,As(Ns.get(h)||null,e,n,r,s,d)),!0;case"gotpointercapture":return h=d.pointerId,js.set(h,As(js.get(h)||null,e,n,r,s,d)),!0}return!1}function Fv(e){var n=Nr(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,rp(e.priority,function(){Iv(r)});return}}else if(n===31){if(n=m(r),n!==null){e.blockedOn=n,rp(e.priority,function(){Iv(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 vl(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var r=Id(e.nativeEvent);if(r===null){r=e.nativeEvent;var s=new r.constructor(r.type,r);qc=s,r.target.dispatchEvent(s),qc=null}else return n=jr(r),n!==null&&Wv(n),e.blockedOn=r,!1;n.shift()}return!0}function Kv(e,n,r){vl(e)&&r.delete(n)}function O2(){Pd=!1,_a!==null&&vl(_a)&&(_a=null),Ra!==null&&vl(Ra)&&(Ra=null),Oa!==null&&vl(Oa)&&(Oa=null),Ns.forEach(Kv),js.forEach(Kv)}function yl(e,n){e.blockedOn===n&&(e.blockedOn=null,Pd||(Pd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,O2)))}var bl=null;function Yv(e){bl!==e&&(bl=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){bl===e&&(bl=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(qd(s||r)===null)continue;break}var h=jr(r);h!==null&&(e.splice(n,3),n-=3,Iu(h,{pending:!0,data:d,method:r.method,action:s},s,d))}}))}function co(e){function n(z){return yl(z,e)}_a!==null&&yl(_a,e),Ra!==null&&yl(Ra,e),Oa!==null&&yl(Oa,e),Ns.forEach(n),js.forEach(n);for(var r=0;r<Da.length;r++){var s=Da[r];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Da.length&&(r=Da[0],r.blockedOn===null);)Fv(r),r.blockedOn===null&&Da.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[jt]||null;if(typeof h=="function")x||Yv(r);else if(x){var A=null;if(h&&h.hasAttribute("formAction")){if(d=h,x=h[jt]||null)A=x.formAction;else if(qd(d)!==null)continue}else A=x.action;typeof A=="function"?r[s+1]=A:(r.splice(s,3),s-=3),Yv(r)}}}function Vv(){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 Fd(e){this._internalRoot=e}wl.prototype.render=Fd.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));var r=n.current,s=Gt();Bv(r,s,e,n,null,null)},wl.prototype.unmount=Fd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Bv(e.current,2,null,e,null,null),el(),n[Tr]=null}};function wl(e){this._internalRoot=e}wl.prototype.unstable_scheduleHydration=function(e){if(e){var n=ap();e={blockedOn:null,target:e,priority:n};for(var r=0;r<Da.length&&n!==0&&n<Da[r].priority;r++);Da.splice(r,0,e),r===0&&Fv(e)}};var $v=a.version;if($v!=="19.2.5")throw Error(i(527,$v,"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=p(n),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var D2={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xl.isDisabled&&xl.supportsFiber)try{Bo=xl.inject(D2),It=xl}catch{}}return Rs.createRoot=function(e,n){if(!l(e))throw Error(i(299));var r=!1,s="",d=tg,h=ng,x=ag;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=zv(e,1,!1,null,null,r,s,null,d,h,x,Vv),e[Tr]=n.current,Cd(e),new Fd(n)},Rs.hydrateRoot=function(e,n,r){if(!l(e))throw Error(i(299));var s=!1,d="",h=tg,x=ng,A=ag,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&&(A=r.onRecoverableError),r.formState!==void 0&&(z=r.formState)),n=zv(e,1,!0,n,r??null,s,d,z,h,x,A,Vv),n.context=Hv(null),r=n.current,s=Gt(),s=Mc(s),d=ya(s),d.callback=null,ba(r,d,s),r=s,n.current.lanes=r,Wo(n,r),_n(n),e[Tr]=n.current,Cd(e),new wl(n)},Rs.version="19.2.5",Rs}var ry;function F2(){if(ry)return Vd.exports;ry=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(),Vd.exports=P2(),Vd.exports}var K2=F2();const Y2="modulepreload",V2=function(t){return"/"+t},oy={},Nt=function(a,o,i){let l=Promise.resolve();if(o&&o.length>0){let g=function(p){return Promise.all(p.map(y=>Promise.resolve(y).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),m=f?.nonce||f?.getAttribute("nonce");l=g(o.map(p=>{if(p=V2(p),p in oy)return;oy[p]=!0;const y=p.endsWith(".css"),v=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${v}`))return;const k=document.createElement("link");if(k.rel=y?"stylesheet":Y2,y||(k.as="script"),k.crossOrigin="",k.href=p,m&&k.setAttribute("nonce",m),document.head.appendChild(k),y)return new Promise((S,T)=>{k.addEventListener("load",S),k.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${p}`)))})}))}function u(f){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=f,window.dispatchEvent(m),!m.defaultPrevented)throw f}return l.then(f=>{for(const m of f||[])m.status==="rejected"&&u(m.reason);return a().catch(u)})},$2=b.lazy(()=>Nt(()=>import("./WorkspaceTaskDrawer-CJcFZh8C.js"),__vite__mapDeps([0,1])).then(t=>({default:t.WorkspaceTaskDrawer}))),G2=b.lazy(()=>Nt(()=>import("./AddWorkspaceFlow-BjpjCuRe.js"),[]).then(t=>({default:t.AddWorkspaceFlow}))),X2=b.lazy(()=>Nt(()=>import("./FirstRunWizard-BuLgUAny.js"),[]).then(t=>({default:t.FirstRunWizard}))),Z2=b.lazy(()=>Nt(()=>import("./WhatsNewDialog-DpgjEIaA.js"),[]).then(t=>({default:t.WhatsNewDialog}))),Q2=({addDialogTrigger:t,onAddWorkspace:a,onCloseTaskGraph:o,onCloseWizard:i,onCreateWorkspace:l,onTryDemo:u,taskGraphOpen:f,tasksFile:m,wizardOpen:g,whatsNewOpen:p,whatsNewEntries:y,onCloseWhatsNew:v,workspacePath:k,workers:S,onSelectOwner:T,connectionStale:w})=>c.jsxs(c.Fragment,{children:[k?c.jsx(b.Suspense,{fallback:null,children:c.jsx($2,{open:f,tasksFile:m,onClose:o,workspacePath:k,...S?{workers:S}:{},...T?{onSelectOwner:T}:{},...w!==void 0?{connectionStale:w}:{}})}):null,t>0?c.jsx(b.Suspense,{fallback:null,children:c.jsx(G2,{onClose:()=>{},onCreate:l,onTryDemo:u,trigger:t})}):null,g?c.jsx(b.Suspense,{fallback:null,children:c.jsx(X2,{open:g,onClose:i,onAddWorkspace:a,onTryDemo:u})}):null,p?c.jsx(b.Suspense,{fallback:null,children:c.jsx(Z2,{open:p,entries:[...y],onClose:v})}):null]});const Ib=(...t)=>t.filter((a,o,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===o).join(" ").trim();const J2=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const eS=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,o,i)=>i?i.toUpperCase():o.toLowerCase());const sy=t=>{const a=eS(t);return a.charAt(0).toUpperCase()+a.slice(1)};var Zd={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 tS=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1},nS=b.createContext({}),aS=()=>b.useContext(nS),rS=b.forwardRef(({color:t,size:a,strokeWidth:o,absoluteStrokeWidth:i,className:l="",children:u,iconNode:f,...m},g)=>{const{size:p=24,strokeWidth:y=2,absoluteStrokeWidth:v=!1,color:k="currentColor",className:S=""}=aS()??{},T=i??v?Number(o??y)*24/Number(a??p):o??y;return b.createElement("svg",{ref:g,...Zd,width:a??p??Zd.width,height:a??p??Zd.height,stroke:t??k,strokeWidth:T,className:Ib("lucide",S,l),...!u&&!tS(m)&&{"aria-hidden":"true"},...m},[...f.map(([w,E])=>b.createElement(w,E)),...Array.isArray(u)?u:[u]])});const ye=(t,a)=>{const o=b.forwardRef(({className:i,...l},u)=>b.createElement(rS,{ref:u,iconNode:a,className:Ib(`lucide-${J2(sy(t))}`,`lucide-${t}`,i),...l}));return o.displayName=sy(t),o};const oS=[["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"}]],dc=ye("activity",oS);const sS=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],iS=ye("arrow-right",sS);const lS=[["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"}]],Uf=ye("bell",lS);const cS=[["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"}]],uS=ye("book-open-check",cS);const dS=[["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"}]],fS=ye("brain",dS);const mS=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ga=ye("check",mS);const pS=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],No=ye("chevron-down",pS);const hS=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],gS=ye("chevron-left",hS);const vS=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],fc=ye("chevron-right",vS);const yS=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],bS=ye("chevrons-left",yS);const wS=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],xS=ye("chevrons-right",wS);const kS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],qb=ye("circle-check",kS);const SS=[["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"}]],ES=ye("circle-play",SS);const CS=[["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"}]],TS=ye("circle-question-mark",CS);const NS=[["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"}]],jS=ye("circle-x",NS);const AS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],_S=ye("circle",AS);const RS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],OS=ye("clock-3",RS);const DS=[["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"}]],MS=ye("code-xml",DS);const LS=[["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"}]],Cr=ye("copy",LS);const zS=[["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"}]],bm=ye("crown",zS);const HS=[["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"}]],BS=ye("ellipsis-vertical",HS);const US=[["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"}]],wm=ye("external-link",US);const WS=[["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"}]],IS=ye("eye",WS);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"}]],Pb=ye("file-text",qS);const PS=[["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"}]],Pl=ye("flask-conical",PS);const FS=[["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"}]],Fb=ye("folder-plus",FS);const KS=[["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"}]],YS=ye("hammer",KS);const VS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Kb=ye("info",VS);const $S=[["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"}]],GS=ye("languages",$S);const XS=[["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"}]],Qd=ye("laptop",XS);const ZS=[["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"}]],Yb=ye("list-checks",ZS);const QS=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Fa=ye("loader-circle",QS);const JS=[["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"}]],eE=ye("log-out",JS);const tE=[["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"}]],nE=ye("maximize-2",tE);const aE=[["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"}]],rE=ye("minimize-2",aE);const oE=[["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"}]],sE=ye("package",oE);const iE=[["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"}]],Vb=ye("pencil",iE);const lE=[["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"}]],jo=ye("play",lE);const cE=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Fl=ye("plus",cE);const uE=[["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"}]],iy=ye("radio",uE);const dE=[["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"}]],xm=ye("refresh-cw",dE);const fE=[["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"}]],km=ye("rotate-ccw",fE);const mE=[["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"}]],pE=ye("search-check",mE);const hE=[["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"}]],gE=ye("send",hE);const vE=[["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"}]],yE=ye("server-crash",vE);const bE=[["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"}]],Wf=ye("settings",bE);const wE=[["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"}]],xE=ye("shield-check",wE);const kE=[["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"}]],SE=ye("sliders-horizontal",kE);const EE=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],$b=ye("smartphone",EE);const CE=[["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"}]],Gb=ye("sparkles",CE);const TE=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Xb=ye("square",TE);const NE=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],mc=ye("terminal",NE);const jE=[["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"}]],pc=ye("trash-2",jE);const AE=[["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"}]],Fs=ye("triangle-alert",AE);const _E=[["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"}]],Jd=ye("user-plus",_E);const RE=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],OE=ye("user-round",RE);const DE=[["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"}]],hc=ye("users",DE);const ME=[["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"}]],Kl=ye("volume-2",ME);const LE=[["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"}]],Zb=ye("volume-x",LE);const zE=[["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"}]],HE=ye("webhook",zE);const BE=[["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"}]],Qb=ye("workflow",BE);const UE=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ka=ye("x",UE),WE=t=>t==="en"||t==="zh",Jb="hive.uiLanguage",e0={"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 — 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 — locally.","welcome.step1Desc":"Pick a project folder.","welcome.step1Title":"Add a Workspace","welcome.step2Desc":"Antigravity / Claude / Codex / Gemini / OpenCode / Hermes / Qwen.","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.emptyAdd":"Add your first member","worker.emptyDesc":"Add team members (Antigravity CLI, Claude Code, Codex, Gemini, OpenCode, Hermes, Qwen Code) 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"},IE={"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,任选。","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。","welcome.step1Desc":"选择一个项目目录。","welcome.step1Title":"添加 Workspace","welcome.step2Desc":"Antigravity / Claude / Codex / Gemini / OpenCode / Hermes / Qwen。","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.emptyAdd":"添加第一个成员","worker.emptyDesc":"添加团队成员(Antigravity CLI、Claude Code、Codex、Gemini、OpenCode、Hermes、Qwen Code),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:e0,zh:IE},PE=()=>{if(typeof window>"u")return"en";const t=FE();return t||(window.navigator.language.toLowerCase().startsWith("zh")?"zh":"en")},FE=()=>{try{const t=window.localStorage.getItem(Jb);return WE(t)?t:null}catch{return null}},KE=t=>{try{window.localStorage.setItem(Jb,t)}catch{}},t0=t=>(a,o={})=>(qE[t][a]??e0[a]??a).replace(/\{(\w+)\}/g,(l,u)=>{const f=o[u];return f===void 0?l:String(f)}),YE={language:"en",setLanguage:()=>{},t:t0("en")},n0=b.createContext(YE),VE=({children:t})=>{const[a,o]=b.useState(PE),i=b.useMemo(()=>({language:a,setLanguage:u=>{o(u),KE(u)},t:t0(a)}),[a]);return c.jsx(n0.Provider,{value:i,children:t})},we=()=>b.useContext(n0),$E=({onExit:t})=>{const{t:a}=we();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(Gb,{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")})]})},kl=[{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"]}],ef=["Create the Todo API route","Persist todos in SQLite","Add Vitest coverage","Review route behavior","Mark .hive/tasks.md complete"],GE=[{name:"ada-lovelace",role:"Coder"},{name:"socrates",role:"Reviewer"}],XE=({onExit:t})=>{const{t:a}=we(),[o,i]=b.useState(0);b.useEffect(()=>{const f=window.setInterval(()=>{i(m=>(m+1)%kl.length)},1800);return()=>window.clearInterval(f)},[]);const l=kl[o]??kl[0],u=b.useMemo(()=>kl.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($E,{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(mc,{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,ef.length),"/",ef.length]})]}),c.jsx("ul",{className:"space-y-2",children:ef.map((f,m)=>{const g=m<l.doneTasks;return c.jsxs("li",{className:"flex items-start gap-2 text-sm","data-testid":`demo-task-${m}`,"data-done":g||void 0,children:[g?c.jsx(qb,{size:16,className:"mt-0.5 shrink-0 text-status-green"}):c.jsx(_S,{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(hc,{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:GE.map((f,m)=>{const g=l.workerStates[m]??"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 zt(t,a,{checkForDefaultPrevented:o=!0}={}){return function(l){if(t?.(l),o===!1||!l.defaultPrevented)return a?.(l)}}function ly(t,a){if(typeof t=="function")return t(a);t!=null&&(t.current=a)}function a0(...t){return a=>{let o=!1;const i=t.map(l=>{const u=ly(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():ly(t[l],null)}}}}function En(...t){return b.useCallback(a0(...t),t)}function ZE(t,a){const o=b.createContext(a),i=u=>{const{children:f,...m}=u,g=b.useMemo(()=>m,Object.values(m));return c.jsx(o.Provider,{value:g,children:f})};i.displayName=t+"Provider";function l(u){const f=b.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 Sm(t,a=[]){let o=[];function i(u,f){const m=b.createContext(f),g=o.length;o=[...o,f];const p=v=>{const{scope:k,children:S,...T}=v,w=k?.[t]?.[g]||m,E=b.useMemo(()=>T,Object.values(T));return c.jsx(w.Provider,{value:E,children:S})};p.displayName=u+"Provider";function y(v,k){const S=k?.[t]?.[g]||m,T=b.useContext(S);if(T)return T;if(f!==void 0)return f;throw new Error(`\`${v}\` must be used within \`${u}\``)}return[p,y]}const l=()=>{const u=o.map(f=>b.createContext(f));return function(m){const g=m?.[t]||u;return b.useMemo(()=>({[`__scope${t}`]:{...m,[t]:g}}),[m,g])}};return l.scopeName=t,[i,QE(l,...a)]}function QE(...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((m,{useScope:g,scopeName:p})=>{const v=g(u)[`__scope${p}`];return{...m,...v}},{});return b.useMemo(()=>({[`__scope${a.scopeName}`]:f}),[f])}};return o.scopeName=a.scopeName,o}var Ya=globalThis?.document?b.useLayoutEffect:()=>{},JE=Ub[" useId ".trim().toString()]||(()=>{}),eC=0;function Ml(t){const[a,o]=b.useState(JE());return Ya(()=>{o(i=>i??String(eC++))},[t]),t||(a?`radix-${a}`:"")}var tC=Ub[" useInsertionEffect ".trim().toString()]||Ya;function r0({prop:t,defaultProp:a,onChange:o=()=>{},caller:i}){const[l,u,f]=nC({defaultProp:a,onChange:o}),m=t!==void 0,g=m?t:l;{const y=b.useRef(t!==void 0);b.useEffect(()=>{const v=y.current;v!==m&&console.warn(`${i} is changing from ${v?"controlled":"uncontrolled"} to ${m?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=m},[m,i])}const p=b.useCallback(y=>{if(m){const v=aC(y)?y(t):y;v!==t&&f.current?.(v)}else u(y)},[m,t,u,f]);return[g,p]}function nC({defaultProp:t,onChange:a}){const[o,i]=b.useState(t),l=b.useRef(o),u=b.useRef(a);return tC(()=>{u.current=a},[a]),b.useEffect(()=>{l.current!==o&&(u.current?.(o),l.current=o)},[o,l]),[o,i,u]}function aC(t){return typeof t=="function"}var gc=Wb();const rC=Bb(gc);function o0(t){const a=oC(t),o=b.forwardRef((i,l)=>{const{children:u,...f}=i,m=b.Children.toArray(u),g=m.find(iC);if(g){const p=g.props.children,y=m.map(v=>v===g?b.Children.count(p)>1?b.Children.only(null):b.isValidElement(p)?p.props.children:null:v);return c.jsx(a,{...f,ref:l,children:b.isValidElement(p)?b.cloneElement(p,void 0,y):null})}return c.jsx(a,{...f,ref:l,children:u})});return o.displayName=`${t}.Slot`,o}function oC(t){const a=b.forwardRef((o,i)=>{const{children:l,...u}=o;if(b.isValidElement(l)){const f=cC(l),m=lC(u,l.props);return l.type!==b.Fragment&&(m.ref=i?a0(i,f):f),b.cloneElement(l,m)}return b.Children.count(l)>1?b.Children.only(null):null});return a.displayName=`${t}.SlotClone`,a}var s0=Symbol("radix.slottable");function sC(t){const a=({children:o})=>c.jsx(c.Fragment,{children:o});return a.displayName=`${t}.Slottable`,a.__radixId=s0,a}function iC(t){return b.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===s0}function lC(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]=(...m)=>{const g=u(...m);return l(...m),g}:l&&(o[i]=l):i==="style"?o[i]={...l,...u}:i==="className"&&(o[i]=[l,u].filter(Boolean).join(" "))}return{...t,...o}}function cC(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 uC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ut=uC.reduce((t,a)=>{const o=o0(`Primitive.${a}`),i=b.forwardRef((l,u)=>{const{asChild:f,...m}=l,g=f?o:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(g,{...m,ref:u})});return i.displayName=`Primitive.${a}`,{...t,[a]:i}},{});function dC(t,a){t&&gc.flushSync(()=>t.dispatchEvent(a))}function xo(t){const a=b.useRef(t);return b.useEffect(()=>{a.current=t}),b.useMemo(()=>(...o)=>a.current?.(...o),[])}function fC(t,a=globalThis?.document){const o=xo(t);b.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 mC="DismissableLayer",If="dismissableLayer.update",pC="dismissableLayer.pointerDownOutside",hC="dismissableLayer.focusOutside",cy,i0=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Em=b.forwardRef((t,a)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:f,onDismiss:m,...g}=t,p=b.useContext(i0),[y,v]=b.useState(null),k=y?.ownerDocument??globalThis?.document,[,S]=b.useState({}),T=En(a,L=>v(L)),w=Array.from(p.layers),[E]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),C=w.indexOf(E),j=y?w.indexOf(y):-1,_=p.layersWithOutsidePointerEventsDisabled.size>0,N=j>=C,O=yC(L=>{const U=L.target,q=[...p.branches].some(ae=>ae.contains(U));!N||q||(l?.(L),f?.(L),L.defaultPrevented||m?.())},k),M=bC(L=>{const U=L.target;[...p.branches].some(ae=>ae.contains(U))||(u?.(L),f?.(L),L.defaultPrevented||m?.())},k);return fC(L=>{j===p.layers.size-1&&(i?.(L),!L.defaultPrevented&&m&&(L.preventDefault(),m()))},k),b.useEffect(()=>{if(y)return o&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(cy=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(y)),p.layers.add(y),uy(),()=>{o&&p.layersWithOutsidePointerEventsDisabled.size===1&&(k.body.style.pointerEvents=cy)}},[y,k,o,p]),b.useEffect(()=>()=>{y&&(p.layers.delete(y),p.layersWithOutsidePointerEventsDisabled.delete(y),uy())},[y,p]),b.useEffect(()=>{const L=()=>S({});return document.addEventListener(If,L),()=>document.removeEventListener(If,L)},[]),c.jsx(Ut.div,{...g,ref:T,style:{pointerEvents:_?N?"auto":"none":void 0,...t.style},onFocusCapture:zt(t.onFocusCapture,M.onFocusCapture),onBlurCapture:zt(t.onBlurCapture,M.onBlurCapture),onPointerDownCapture:zt(t.onPointerDownCapture,O.onPointerDownCapture)})});Em.displayName=mC;var gC="DismissableLayerBranch",vC=b.forwardRef((t,a)=>{const o=b.useContext(i0),i=b.useRef(null),l=En(a,i);return b.useEffect(()=>{const u=i.current;if(u)return o.branches.add(u),()=>{o.branches.delete(u)}},[o.branches]),c.jsx(Ut.div,{...t,ref:l})});vC.displayName=gC;function yC(t,a=globalThis?.document){const o=xo(t),i=b.useRef(!1),l=b.useRef(()=>{});return b.useEffect(()=>{const u=m=>{if(m.target&&!i.current){let g=function(){l0(pC,o,p,{discrete:!0})};const p={originalEvent:m};m.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 bC(t,a=globalThis?.document){const o=xo(t),i=b.useRef(!1);return b.useEffect(()=>{const l=u=>{u.target&&!i.current&&l0(hC,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 uy(){const t=new CustomEvent(If);document.dispatchEvent(t)}function l0(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?dC(l,u):l.dispatchEvent(u)}var tf="focusScope.autoFocusOnMount",nf="focusScope.autoFocusOnUnmount",dy={bubbles:!1,cancelable:!0},wC="FocusScope",c0=b.forwardRef((t,a)=>{const{loop:o=!1,trapped:i=!1,onMountAutoFocus:l,onUnmountAutoFocus:u,...f}=t,[m,g]=b.useState(null),p=xo(l),y=xo(u),v=b.useRef(null),k=En(a,w=>g(w)),S=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(i){let w=function(_){if(S.paused||!m)return;const N=_.target;m.contains(N)?v.current=N:Ba(v.current,{select:!0})},E=function(_){if(S.paused||!m)return;const N=_.relatedTarget;N!==null&&(m.contains(N)||Ba(v.current,{select:!0}))},C=function(_){if(document.activeElement===document.body)for(const O of _)O.removedNodes.length>0&&Ba(m)};document.addEventListener("focusin",w),document.addEventListener("focusout",E);const j=new MutationObserver(C);return m&&j.observe(m,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",E),j.disconnect()}}},[i,m,S.paused]),b.useEffect(()=>{if(m){my.add(S);const w=document.activeElement;if(!m.contains(w)){const C=new CustomEvent(tf,dy);m.addEventListener(tf,p),m.dispatchEvent(C),C.defaultPrevented||(xC(TC(u0(m)),{select:!0}),document.activeElement===w&&Ba(m))}return()=>{m.removeEventListener(tf,p),setTimeout(()=>{const C=new CustomEvent(nf,dy);m.addEventListener(nf,y),m.dispatchEvent(C),C.defaultPrevented||Ba(w??document.body,{select:!0}),m.removeEventListener(nf,y),my.remove(S)},0)}}},[m,p,y,S]);const T=b.useCallback(w=>{if(!o&&!i||S.paused)return;const E=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,C=document.activeElement;if(E&&C){const j=w.currentTarget,[_,N]=kC(j);_&&N?!w.shiftKey&&C===N?(w.preventDefault(),o&&Ba(_,{select:!0})):w.shiftKey&&C===_&&(w.preventDefault(),o&&Ba(N,{select:!0})):C===j&&w.preventDefault()}},[o,i,S.paused]);return c.jsx(Ut.div,{tabIndex:-1,...f,ref:k,onKeyDown:T})});c0.displayName=wC;function xC(t,{select:a=!1}={}){const o=document.activeElement;for(const i of t)if(Ba(i,{select:a}),document.activeElement!==o)return}function kC(t){const a=u0(t),o=fy(a,t),i=fy(a.reverse(),t);return[o,i]}function u0(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 fy(t,a){for(const o of t)if(!SC(o,{upTo:a}))return o}function SC(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 EC(t){return t instanceof HTMLInputElement&&"select"in t}function Ba(t,{select:a=!1}={}){if(t&&t.focus){const o=document.activeElement;t.focus({preventScroll:!0}),t!==o&&EC(t)&&a&&t.select()}}var my=CC();function CC(){let t=[];return{add(a){const o=t[0];a!==o&&o?.pause(),t=py(t,a),t.unshift(a)},remove(a){t=py(t,a),t[0]?.resume()}}}function py(t,a){const o=[...t],i=o.indexOf(a);return i!==-1&&o.splice(i,1),o}function TC(t){return t.filter(a=>a.tagName!=="A")}var NC="Portal",Cm=b.forwardRef((t,a)=>{const{container:o,...i}=t,[l,u]=b.useState(!1);Ya(()=>u(!0),[]);const f=o||l&&globalThis?.document?.body;return f?rC.createPortal(c.jsx(Ut.div,{...i,ref:a}),f):null});Cm.displayName=NC;function jC(t,a){return b.useReducer((o,i)=>a[o][i]??o,t)}var Ao=t=>{const{present:a,children:o}=t,i=AC(a),l=typeof o=="function"?o({present:i.isPresent}):b.Children.only(o),u=En(i.ref,_C(l));return typeof o=="function"||i.isPresent?b.cloneElement(l,{ref:u}):null};Ao.displayName="Presence";function AC(t){const[a,o]=b.useState(),i=b.useRef(null),l=b.useRef(t),u=b.useRef("none"),f=t?"mounted":"unmounted",[m,g]=jC(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const p=Sl(i.current);u.current=m==="mounted"?p:"none"},[m]),Ya(()=>{const p=i.current,y=l.current;if(y!==t){const k=u.current,S=Sl(p);t?g("MOUNT"):S==="none"||p?.display==="none"?g("UNMOUNT"):g(y&&k!==S?"ANIMATION_OUT":"UNMOUNT"),l.current=t}},[t,g]),Ya(()=>{if(a){let p;const y=a.ownerDocument.defaultView??window,v=S=>{const w=Sl(i.current).includes(CSS.escape(S.animationName));if(S.target===a&&w&&(g("ANIMATION_END"),!l.current)){const E=a.style.animationFillMode;a.style.animationFillMode="forwards",p=y.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=E)})}},k=S=>{S.target===a&&(u.current=Sl(i.current))};return a.addEventListener("animationstart",k),a.addEventListener("animationcancel",v),a.addEventListener("animationend",v),()=>{y.clearTimeout(p),a.removeEventListener("animationstart",k),a.removeEventListener("animationcancel",v),a.removeEventListener("animationend",v)}}else g("ANIMATION_END")},[a,g]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:b.useCallback(p=>{i.current=p?getComputedStyle(p):null,o(p)},[])}}function Sl(t){return t?.animationName||"none"}function _C(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 af=0;function RC(){b.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??hy()),document.body.insertAdjacentElement("beforeend",t[1]??hy()),af++,()=>{af===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),af--}},[])}function hy(){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 Dn=function(){return Dn=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},Dn.apply(this,arguments)};function d0(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 OC(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 Ll="right-scroll-bar-position",zl="width-before-scroll-bar",DC="with-scroll-bars-hidden",MC="--removed-body-scroll-bar-size";function rf(t,a){return typeof t=="function"?t(a):t&&(t.current=a),t}function LC(t,a){var o=b.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 zC=typeof window<"u"?b.useLayoutEffect:b.useEffect,gy=new WeakMap;function HC(t,a){var o=LC(null,function(i){return t.forEach(function(l){return rf(l,i)})});return zC(function(){var i=gy.get(o);if(i){var l=new Set(i),u=new Set(t),f=o.current;l.forEach(function(m){u.has(m)||rf(m,null)}),u.forEach(function(m){l.has(m)||rf(m,f)})}gy.set(o,t)},[t]),o}function BC(t){return t}function UC(t,a){a===void 0&&(a=BC);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(m){return m!==f})}},assignSyncMedium:function(u){for(i=!0;o.length;){var f=o;o=[],f.forEach(u)}o={push:function(m){return u(m)},filter:function(){return o}}},assignMedium:function(u){i=!0;var f=[];if(o.length){var m=o;o=[],m.forEach(u),f=o}var g=function(){var y=f;f=[],y.forEach(u)},p=function(){return Promise.resolve().then(g)};p(),o={push:function(y){f.push(y),p()},filter:function(y){return f=f.filter(y),o}}}};return l}function WC(t){t===void 0&&(t={});var a=UC(null);return a.options=Dn({async:!0,ssr:!1},t),a}var f0=function(t){var a=t.sideCar,o=d0(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 b.createElement(i,Dn({},o))};f0.isSideCarExport=!0;function IC(t,a){return t.useMedium(a),f0}var m0=WC(),of=function(){},vc=b.forwardRef(function(t,a){var o=b.useRef(null),i=b.useState({onScrollCapture:of,onWheelCapture:of,onTouchMoveCapture:of}),l=i[0],u=i[1],f=t.forwardProps,m=t.children,g=t.className,p=t.removeScrollBar,y=t.enabled,v=t.shards,k=t.sideCar,S=t.noRelative,T=t.noIsolation,w=t.inert,E=t.allowPinchZoom,C=t.as,j=C===void 0?"div":C,_=t.gapMode,N=d0(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=k,M=HC([o,a]),L=Dn(Dn({},N),l);return b.createElement(b.Fragment,null,y&&b.createElement(O,{sideCar:m0,removeScrollBar:p,shards:v,noRelative:S,noIsolation:T,inert:w,setCallbacks:u,allowPinchZoom:!!E,lockRef:o,gapMode:_}),f?b.cloneElement(b.Children.only(m),Dn(Dn({},L),{ref:M})):b.createElement(j,Dn({},L,{className:g,ref:M}),m))});vc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};vc.classNames={fullWidth:zl,zeroRight:Ll};var qC=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function PC(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var a=qC();return a&&t.setAttribute("nonce",a),t}function FC(t,a){t.styleSheet?t.styleSheet.cssText=a:t.appendChild(document.createTextNode(a))}function KC(t){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(t)}var YC=function(){var t=0,a=null;return{add:function(o){t==0&&(a=PC())&&(FC(a,o),KC(a)),t++},remove:function(){t--,!t&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},VC=function(){var t=YC();return function(a,o){b.useEffect(function(){return t.add(a),function(){t.remove()}},[a&&o])}},p0=function(){var t=VC(),a=function(o){var i=o.styles,l=o.dynamic;return t(i,l),null};return a},$C={left:0,top:0,right:0,gap:0},sf=function(t){return parseInt(t||"",10)||0},GC=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[sf(o),sf(i),sf(l)]},XC=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return $C;var a=GC(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])}},ZC=p0(),vo="data-scroll-locked",QC=function(t,a,o,i){var l=t.left,u=t.top,f=t.right,m=t.gap;return o===void 0&&(o="margin"),`
|
|
12
|
+
.`.concat(DC,` {
|
|
13
|
+
overflow: hidden `).concat(i,`;
|
|
14
|
+
padding-right: `).concat(m,"px ").concat(i,`;
|
|
15
|
+
}
|
|
16
|
+
body[`).concat(vo,`] {
|
|
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(m,"px ").concat(i,`;
|
|
26
|
+
`),o==="padding"&&"padding-right: ".concat(m,"px ").concat(i,";")].filter(Boolean).join(""),`
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.`).concat(Ll,` {
|
|
30
|
+
right: `).concat(m,"px ").concat(i,`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.`).concat(zl,` {
|
|
34
|
+
margin-right: `).concat(m,"px ").concat(i,`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.`).concat(Ll," .").concat(Ll,` {
|
|
38
|
+
right: 0 `).concat(i,`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.`).concat(zl," .").concat(zl,` {
|
|
42
|
+
margin-right: 0 `).concat(i,`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
body[`).concat(vo,`] {
|
|
46
|
+
`).concat(MC,": ").concat(m,`px;
|
|
47
|
+
}
|
|
48
|
+
`)},vy=function(){var t=parseInt(document.body.getAttribute(vo)||"0",10);return isFinite(t)?t:0},JC=function(){b.useEffect(function(){return document.body.setAttribute(vo,(vy()+1).toString()),function(){var t=vy()-1;t<=0?document.body.removeAttribute(vo):document.body.setAttribute(vo,t.toString())}},[])},eT=function(t){var a=t.noRelative,o=t.noImportant,i=t.gapMode,l=i===void 0?"margin":i;JC();var u=b.useMemo(function(){return XC(l)},[l]);return b.createElement(ZC,{styles:QC(u,!a,l,o?"":"!important")})},qf=!1;if(typeof window<"u")try{var El=Object.defineProperty({},"passive",{get:function(){return qf=!0,!0}});window.addEventListener("test",El,El),window.removeEventListener("test",El,El)}catch{qf=!1}var uo=qf?{passive:!1}:!1,tT=function(t){return t.tagName==="TEXTAREA"},h0=function(t,a){if(!(t instanceof Element))return!1;var o=window.getComputedStyle(t);return o[a]!=="hidden"&&!(o.overflowY===o.overflowX&&!tT(t)&&o[a]==="visible")},nT=function(t){return h0(t,"overflowY")},aT=function(t){return h0(t,"overflowX")},yy=function(t,a){var o=a.ownerDocument,i=a;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var l=g0(t,i);if(l){var u=v0(t,i),f=u[1],m=u[2];if(f>m)return!0}i=i.parentNode}while(i&&i!==o.body);return!1},rT=function(t){var a=t.scrollTop,o=t.scrollHeight,i=t.clientHeight;return[a,o,i]},oT=function(t){var a=t.scrollLeft,o=t.scrollWidth,i=t.clientWidth;return[a,o,i]},g0=function(t,a){return t==="v"?nT(a):aT(a)},v0=function(t,a){return t==="v"?rT(a):oT(a)},sT=function(t,a){return t==="h"&&a==="rtl"?-1:1},iT=function(t,a,o,i,l){var u=sT(t,window.getComputedStyle(a).direction),f=u*i,m=o.target,g=a.contains(m),p=!1,y=f>0,v=0,k=0;do{if(!m)break;var S=v0(t,m),T=S[0],w=S[1],E=S[2],C=w-E-u*T;(T||C)&&g0(t,m)&&(v+=C,k+=T);var j=m.parentNode;m=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!g&&m!==document.body||g&&(a.contains(m)||a===m));return(y&&Math.abs(v)<1||!y&&Math.abs(k)<1)&&(p=!0),p},Cl=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},by=function(t){return[t.deltaX,t.deltaY]},wy=function(t){return t&&"current"in t?t.current:t},lT=function(t,a){return t[0]===a[0]&&t[1]===a[1]},cT=function(t){return`
|
|
49
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
50
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
51
|
+
`)},uT=0,fo=[];function dT(t){var a=b.useRef([]),o=b.useRef([0,0]),i=b.useRef(),l=b.useState(uT++)[0],u=b.useState(p0)[0],f=b.useRef(t);b.useEffect(function(){f.current=t},[t]),b.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(l));var w=OC([t.lockRef.current],(t.shards||[]).map(wy),!0).filter(Boolean);return w.forEach(function(E){return E.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),w.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(l))})}}},[t.inert,t.lockRef.current,t.shards]);var m=b.useCallback(function(w,E){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!f.current.allowPinchZoom;var C=Cl(w),j=o.current,_="deltaX"in w?w.deltaX:j[0]-C[0],N="deltaY"in w?w.deltaY:j[1]-C[1],O,M=w.target,L=Math.abs(_)>Math.abs(N)?"h":"v";if("touches"in w&&L==="h"&&M.type==="range")return!1;var U=window.getSelection(),q=U&&U.anchorNode,ae=q?q===M||q.contains(M):!1;if(ae)return!1;var ee=yy(L,M);if(!ee)return!0;if(ee?O=L:(O=L==="v"?"h":"v",ee=yy(L,M)),!ee)return!1;if(!i.current&&"changedTouches"in w&&(_||N)&&(i.current=O),!O)return!0;var F=i.current||O;return iT(F,E,w,F==="h"?_:N)},[]),g=b.useCallback(function(w){var E=w;if(!(!fo.length||fo[fo.length-1]!==u)){var C="deltaY"in E?by(E):Cl(E),j=a.current.filter(function(O){return O.name===E.type&&(O.target===E.target||E.target===O.shadowParent)&&lT(O.delta,C)})[0];if(j&&j.should){E.cancelable&&E.preventDefault();return}if(!j){var _=(f.current.shards||[]).map(wy).filter(Boolean).filter(function(O){return O.contains(E.target)}),N=_.length>0?m(E,_[0]):!f.current.noIsolation;N&&E.cancelable&&E.preventDefault()}}},[]),p=b.useCallback(function(w,E,C,j){var _={name:w,delta:E,target:C,should:j,shadowParent:fT(C)};a.current.push(_),setTimeout(function(){a.current=a.current.filter(function(N){return N!==_})},1)},[]),y=b.useCallback(function(w){o.current=Cl(w),i.current=void 0},[]),v=b.useCallback(function(w){p(w.type,by(w),w.target,m(w,t.lockRef.current))},[]),k=b.useCallback(function(w){p(w.type,Cl(w),w.target,m(w,t.lockRef.current))},[]);b.useEffect(function(){return fo.push(u),t.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:k}),document.addEventListener("wheel",g,uo),document.addEventListener("touchmove",g,uo),document.addEventListener("touchstart",y,uo),function(){fo=fo.filter(function(w){return w!==u}),document.removeEventListener("wheel",g,uo),document.removeEventListener("touchmove",g,uo),document.removeEventListener("touchstart",y,uo)}},[]);var S=t.removeScrollBar,T=t.inert;return b.createElement(b.Fragment,null,T?b.createElement(u,{styles:cT(l)}):null,S?b.createElement(eT,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function fT(t){for(var a=null;t!==null;)t instanceof ShadowRoot&&(a=t.host,t=t.host),t=t.parentNode;return a}const mT=IC(m0,dT);var y0=b.forwardRef(function(t,a){return b.createElement(vc,Dn({},t,{ref:a,sideCar:mT}))});y0.classNames=vc.classNames;var pT=function(t){if(typeof document>"u")return null;var a=Array.isArray(t)?t[0]:t;return a.ownerDocument.body},mo=new WeakMap,Tl=new WeakMap,Nl={},lf=0,b0=function(t){return t&&(t.host||b0(t.parentNode))},hT=function(t,a){return a.map(function(o){if(t.contains(o))return o;var i=b0(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})},gT=function(t,a,o,i){var l=hT(a,Array.isArray(t)?t:[t]);Nl[o]||(Nl[o]=new WeakMap);var u=Nl[o],f=[],m=new Set,g=new Set(l),p=function(v){!v||m.has(v)||(m.add(v),p(v.parentNode))};l.forEach(p);var y=function(v){!v||g.has(v)||Array.prototype.forEach.call(v.children,function(k){if(m.has(k))y(k);else try{var S=k.getAttribute(i),T=S!==null&&S!=="false",w=(mo.get(k)||0)+1,E=(u.get(k)||0)+1;mo.set(k,w),u.set(k,E),f.push(k),w===1&&T&&Tl.set(k,!0),E===1&&k.setAttribute(o,"true"),T||k.setAttribute(i,"true")}catch(C){console.error("aria-hidden: cannot operate on ",k,C)}})};return y(a),m.clear(),lf++,function(){f.forEach(function(v){var k=mo.get(v)-1,S=u.get(v)-1;mo.set(v,k),u.set(v,S),k||(Tl.has(v)||v.removeAttribute(i),Tl.delete(v)),S||v.removeAttribute(o)}),lf--,lf||(mo=new WeakMap,mo=new WeakMap,Tl=new WeakMap,Nl={})}},vT=function(t,a,o){o===void 0&&(o="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),l=pT(t);return l?(i.push.apply(i,Array.from(l.querySelectorAll("[aria-live], script"))),gT(i,l,o,"aria-hidden")):function(){return null}},yc="Dialog",[w0]=Sm(yc),[yT,Cn]=w0(yc),x0=t=>{const{__scopeDialog:a,children:o,open:i,defaultOpen:l,onOpenChange:u,modal:f=!0}=t,m=b.useRef(null),g=b.useRef(null),[p,y]=r0({prop:i,defaultProp:l??!1,onChange:u,caller:yc});return c.jsx(yT,{scope:a,triggerRef:m,contentRef:g,contentId:Ml(),titleId:Ml(),descriptionId:Ml(),open:p,onOpenChange:y,onOpenToggle:b.useCallback(()=>y(v=>!v),[y]),modal:f,children:o})};x0.displayName=yc;var k0="DialogTrigger",S0=b.forwardRef((t,a)=>{const{__scopeDialog:o,...i}=t,l=Cn(k0,o),u=En(a,l.triggerRef);return c.jsx(Ut.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":jm(l.open),...i,ref:u,onClick:zt(t.onClick,l.onOpenToggle)})});S0.displayName=k0;var Tm="DialogPortal",[bT,E0]=w0(Tm,{forceMount:void 0}),C0=t=>{const{__scopeDialog:a,forceMount:o,children:i,container:l}=t,u=Cn(Tm,a);return c.jsx(bT,{scope:a,forceMount:o,children:b.Children.map(i,f=>c.jsx(Ao,{present:o||u.open,children:c.jsx(Cm,{asChild:!0,container:l,children:f})}))})};C0.displayName=Tm;var Yl="DialogOverlay",T0=b.forwardRef((t,a)=>{const o=E0(Yl,t.__scopeDialog),{forceMount:i=o.forceMount,...l}=t,u=Cn(Yl,t.__scopeDialog);return u.modal?c.jsx(Ao,{present:i||u.open,children:c.jsx(xT,{...l,ref:a})}):null});T0.displayName=Yl;var wT=o0("DialogOverlay.RemoveScroll"),xT=b.forwardRef((t,a)=>{const{__scopeDialog:o,...i}=t,l=Cn(Yl,o);return c.jsx(y0,{as:wT,allowPinchZoom:!0,shards:[l.contentRef],children:c.jsx(Ut.div,{"data-state":jm(l.open),...i,ref:a,style:{pointerEvents:"auto",...i.style}})})}),Sr="DialogContent",N0=b.forwardRef((t,a)=>{const o=E0(Sr,t.__scopeDialog),{forceMount:i=o.forceMount,...l}=t,u=Cn(Sr,t.__scopeDialog);return c.jsx(Ao,{present:i||u.open,children:u.modal?c.jsx(kT,{...l,ref:a}):c.jsx(ST,{...l,ref:a})})});N0.displayName=Sr;var kT=b.forwardRef((t,a)=>{const o=Cn(Sr,t.__scopeDialog),i=b.useRef(null),l=En(a,o.contentRef,i);return b.useEffect(()=>{const u=i.current;if(u)return vT(u)},[]),c.jsx(j0,{...t,ref:l,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:zt(t.onCloseAutoFocus,u=>{u.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:zt(t.onPointerDownOutside,u=>{const f=u.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0;(f.button===2||m)&&u.preventDefault()}),onFocusOutside:zt(t.onFocusOutside,u=>u.preventDefault())})}),ST=b.forwardRef((t,a)=>{const o=Cn(Sr,t.__scopeDialog),i=b.useRef(!1),l=b.useRef(!1);return c.jsx(j0,{...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()}})}),j0=b.forwardRef((t,a)=>{const{__scopeDialog:o,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:u,...f}=t,m=Cn(Sr,o),g=b.useRef(null),p=En(a,g);return RC(),c.jsxs(c.Fragment,{children:[c.jsx(c0,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:l,onUnmountAutoFocus:u,children:c.jsx(Em,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionId,"aria-labelledby":m.titleId,"data-state":jm(m.open),...f,ref:p,onDismiss:()=>m.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(ET,{titleId:m.titleId}),c.jsx(TT,{contentRef:g,descriptionId:m.descriptionId})]})]})}),Nm="DialogTitle",A0=b.forwardRef((t,a)=>{const{__scopeDialog:o,...i}=t,l=Cn(Nm,o);return c.jsx(Ut.h2,{id:l.titleId,...i,ref:a})});A0.displayName=Nm;var _0="DialogDescription",R0=b.forwardRef((t,a)=>{const{__scopeDialog:o,...i}=t,l=Cn(_0,o);return c.jsx(Ut.p,{id:l.descriptionId,...i,ref:a})});R0.displayName=_0;var O0="DialogClose",D0=b.forwardRef((t,a)=>{const{__scopeDialog:o,...i}=t,l=Cn(O0,o);return c.jsx(Ut.button,{type:"button",...i,ref:a,onClick:zt(t.onClick,()=>l.onOpenChange(!1))})});D0.displayName=O0;function jm(t){return t?"open":"closed"}var M0="DialogTitleWarning",[XD,L0]=ZE(M0,{contentName:Sr,titleName:Nm,docsSlug:"dialog"}),ET=({titleId:t})=>{const a=L0(M0),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 b.useEffect(()=>{t&&(document.getElementById(t)||console.error(o))},[o,t]),null},CT="DialogDescriptionWarning",TT=({contentRef:t,descriptionId:a})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${L0(CT).contentName}}.`;return b.useEffect(()=>{const l=t.current?.getAttribute("aria-describedby");a&&l&&(document.getElementById(a)||console.warn(i))},[i,t,a]),null},_o=x0,NT=S0,Ro=C0,Oo=T0,Do=N0,Mo=A0,ei=R0,ZD=D0;const jT=(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()},AT={requiresUiSession:!0,fetch(t,a){return fetch(t,a)},openWebSocket(t,a){return new WebSocket(jT(t,a))}};let ko=AT;const _T=t=>{ko=t},z0=()=>ko,H0=()=>ko.requiresUiSession!==!1,B0=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}:{}}),Ae=async(t,a)=>{try{const o=await t.json();if(typeof o.error=="string"&&o.error.trim())return o.error}catch{}return a},RT=async t=>{if(t.status!==403)return!1;try{return(await t.clone().json()).error==="UI endpoint requires valid UI token"}catch{return!1}},U0=async()=>{if(!H0())return;const t=await ko.fetch("/api/ui/session",{mode:"same-origin"});if(!t.ok)throw new Error("Failed to initialize UI session");await t.json()};let cf=null;const OT=()=>(cf??=U0().finally(()=>{cf=null}),cf),ge=async(t,a)=>{const o=await ko.fetch(t,a);return!H0()||!await RT(o)?o:(await OT(),ko.fetch(t,a))},DT=async()=>{const t=await ge("/api/workspaces");if(!t.ok)throw new Error("Failed to load workspaces");return await t.json()},MT=async()=>{const t=await ge("/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}},W0=t=>({description:t.description,id:t.id,isBuiltin:t.is_builtin,name:t.name,roleType:t.role_type}),LT=t=>({name:t.name,role_type:t.roleType,description:t.description,default_command:"",default_args:[],default_env:{}}),zT=async t=>{const a=await ge("/api/workspaces",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(!a.ok)throw new Error(await Ae(a,"Failed to create workspace"));return await a.json()},HT=async t=>{const a=await ge(`/api/workspaces/${t}`,{method:"DELETE"});if(!a.ok)throw new Error(await Ae(a,"Failed to delete workspace"))},Vl=async(t,a)=>{const o=await ge(`/api/workspaces/${t}/agents/${a}/start`,{method:"POST"});if(!o.ok)throw new Error(await Ae(o,"Failed to start agent run"));return{runId:(await o.json()).run_id}},$l=async t=>{if(!(await ge(`/api/runtime/runs/${t}/stop`,{method:"POST"})).ok)throw new Error("Failed to stop agent run")},BT=async(t,a,o)=>(await $l(o).catch(i=>{console.error("[hive] swallowed:restartAgentRun.stop",i)}),Vl(t,a)),UT=async()=>{const t=await ge("/api/settings/app-state/active_workspace_id");if(!t.ok)throw new Error("Failed to load active workspace");return(await t.json()).value},I0=async t=>{if(!(await ge("/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")},q0="notifications.webhook-url",WT=async()=>{const t=await ge(`/api/settings/app-state/${q0}`);if(!t.ok)throw new Error("Failed to load webhook URL");return(await t.json()).value??""},IT=async t=>{if(!(await ge(`/api/settings/app-state/${q0}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({value:t.trim()})})).ok)throw new Error("Failed to save webhook URL")},QD=async()=>{const t=await ge("/api/settings/workflow-cli-policy");if(!t.ok)throw new Error("Failed to load workflow CLI policy");return await t.json()},JD=async t=>{const a=await ge("/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()},qT=async()=>{const t=await ge("/api/settings/workflow-feature");if(!t.ok)throw new Error("Failed to load workflow feature flag");return await t.json()},PT=async t=>{const a=await ge("/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()},FT=async()=>{const t=await ge("/api/settings/team-autostaff");if(!t.ok)throw new Error("Failed to load auto-staff feature flag");return await t.json()},KT=async t=>{const a=await ge("/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()},YT=async t=>{const a=await ge(`/api/ui/workspaces/${t}/team`,{mode:"same-origin"});if(!a.ok)throw new Error("Failed to load workers");return(await a.json()).map(B0)},VT=async()=>{const t=await ge("/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}))},$T=t=>`${t}:shell`,bc=(t,a)=>t.agent_id===$T(a),GT=async t=>{const a=await ge(`/api/workspaces/${t}/shell/start`,{method:"POST"});if(!a.ok)throw new Error(await Ae(a,"Failed to start workspace terminal"));return await a.json()},XT=async(t,a)=>{const o=await ge(`/api/workspaces/${t}/shell/${a}`,{method:"DELETE"});if(!o.ok)throw new Error(await Ae(o,"Failed to close workspace terminal"))},ZT=async()=>{const t=await ge("/api/settings/role-templates",{mode:"same-origin"});if(!t.ok)throw new Error("Failed to load role templates");return(await t.json()).map(W0)},QT=async t=>{const a=await ge("/api/settings/role-templates",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(LT(t))});if(!a.ok)throw new Error(await Ae(a,"Failed to create role template"));return W0(await a.json())},JT=async t=>{const a=await ge(`/api/settings/role-templates/${t}`,{method:"DELETE"});if(!a.ok)throw new Error(await Ae(a,"Failed to delete role template"))},eM=async t=>{const a=await ge(`/api/marketplace/manifest?lang=${t}`,{mode:"same-origin"});if(!a.ok)throw new Error(await Ae(a,"Failed to load marketplace manifest"));return await a.json()},tM=async(t,a)=>{const o=await ge(`/api/marketplace/agent?lang=${t}&path=${encodeURIComponent(a)}`,{mode:"same-origin"});if(!o.ok)throw new Error(await Ae(o,"Failed to load marketplace agent"));return await o.json()},eN=async t=>{const a=await ge(`/api/ui/workspaces/${t}/runs`,{mode:"same-origin"});if(!a.ok)throw new Error("Failed to load terminal runs");return await a.json()},tN=async(t,a)=>{const o=await ge(`/api/workspaces/${t}/workers`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(a)});if(!o.ok)throw new Error(await Ae(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:B0(i)}},nN=async(t,a,o,i)=>{const l=await ge(`/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 Ae(l,"Failed to assemble the scenario team"));return{createdWorkers:(await l.json()).created_workers}},aN=async(t,a)=>{const o=await ge(`/api/workspaces/${t}/workers/${a}`,{method:"DELETE"});if(!o.ok)throw new Error(await Ae(o,"Failed to delete worker"))},rN=async(t,a,o)=>{const i=await ge(`/api/workspaces/${t}/workers/${a}`,{body:JSON.stringify({name:o}),headers:{"content-type":"application/json"},method:"PATCH"});if(!i.ok)throw new Error(await Ae(i,"Failed to rename worker"))},oN=async t=>{const a=await ge(`/api/workspaces/${t}/tasks`);if(!a.ok)throw new Error("Failed to load tasks");return await a.json()},jl=async(t,a)=>{const o=await ge(`/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()},nM=async t=>{const a=t?`?path=${encodeURIComponent(t)}`:"";return await(await ge(`/api/fs/browse${a}`,{mode:"same-origin"})).json()},aM=async t=>await(await ge(`/api/fs/probe?path=${encodeURIComponent(t)}`,{mode:"same-origin"})).json(),rM=async()=>await(await ge("/api/fs/pick-folder",{method:"POST",mode:"same-origin"})).json(),sN=async(t,a)=>{const o=await ge(`/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 Ae(o,"Failed to open workspace"))},iN=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}),wc=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(iN),status:t.status,tags:t.tags,updatedAt:t.updated_at,workspaceId:t.workspace_id}),lN=t=>({contextType:t.context_type,dispatchId:t.dispatch_id,id:t.id,injectedAt:t.injected_at,memory:wc(t.memory),memoryId:t.memory_id,targetAgentIdSnapshot:t.target_agent_id_snapshot,workspaceId:t.workspace_id}),oM=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 ge(`/api/ui/workspaces/${t}/memory${i}`);if(!l.ok)throw new Error(await Ae(l,"Failed to load memory"));return(await l.json()).memories.map(wc)},sM=async(t,a,o)=>{const i=await ge(`/api/ui/workspaces/${t}/memory/${a}`,{body:JSON.stringify(o),headers:{"content-type":"application/json"},method:"PATCH"});if(!i.ok)throw new Error(await Ae(i,"Failed to update memory"));const l=await i.json();return wc(l.memory)},cN=async(t,a,o)=>{const i=await ge(`/api/ui/workspaces/${t}/memory/${a}/${o}`,{method:"POST"});if(!i.ok)throw new Error(await Ae(i,`Failed to ${o} memory`));const l=await i.json();return wc(l.memory)},iM=(t,a)=>cN(t,a,"archive"),Am=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}),lM=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 ge(`/api/ui/workspaces/${t}/memory/dream-runs${i}`);if(!l.ok)throw new Error(await Ae(l,"Failed to load dream runs"));return(await l.json()).runs.map(Am)},cM=async t=>{const a=await ge(`/api/ui/workspaces/${t}/memory/dream-runs`,{body:JSON.stringify({}),headers:{"content-type":"application/json"},method:"POST"});if(!a.ok)throw new Error(await Ae(a,"Failed to run dream"));const o=await a.json();return Am(o.run)},uM=async(t,a)=>{const o=await ge(`/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 Ae(o,"Failed to revert dream run"));const i=await o.json();return Am(i.run)},dM=async t=>{const a=await ge(`/api/ui/workspaces/${t}/memory/settings`);if(!a.ok)throw new Error(await Ae(a,"Failed to load memory settings"));const o=await a.json();return{dreamEnabled:o.dream_enabled,enabled:o.enabled}},fM=async(t,a)=>{const o=await ge(`/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 Ae(o,"Failed to update memory settings"));const i=await o.json();return{dreamEnabled:i.dream_enabled,enabled:i.enabled}},mM=async(t,a)=>{const o=new URLSearchParams({dispatch_id:a}),i=await ge(`/api/ui/workspaces/${t}/memory/injections?${o}`);if(!i.ok)throw new Error(await Ae(i,"Failed to load memory injections"));return(await i.json()).injections.map(lN)},uN=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}),pM=async t=>{const a=await ge(`/api/workspaces/${t}/workflows/runs`);if(!a.ok)throw new Error(await Ae(a,"Failed to list workflow runs"));return(await a.json()).runs.map(uN)},P0=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}),hM=async t=>{const a=await ge(`/api/workspaces/${t}/workflow-schedules`);if(!a.ok)throw new Error(await Ae(a,"Failed to list workflow schedules"));return(await a.json()).schedules.map(P0)},gM=async(t,a)=>{const o=await ge(`/api/workflow-schedules/${t}`,{body:JSON.stringify(a),headers:{"content-type":"application/json"},method:"PATCH"});if(!o.ok)throw new Error(await Ae(o,"Failed to update workflow schedule"));const i=await o.json();return P0(i.schedule)},dN=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}:{}}),vM=async t=>{const a=await ge(`/api/workflows/runs/${t}/stop`,{method:"POST"});if(!a.ok)throw new Error(await Ae(a,"Failed to stop workflow run"))},yM=async t=>{const a=await ge(`/api/workflows/runs/${t}/dispatches`);if(!a.ok)throw new Error(await Ae(a,"Failed to load workflow run dispatches"));return(await a.json()).dispatches.map(dN)},bM=async t=>{const a=await ge(`/api/workflows/runs/${t}/logs`);if(!a.ok)throw new Error(await Ae(a,"Failed to load workflow run logs"));return(await a.json()).logs},wM=async t=>{const a=await ge(`/api/workflow-schedules/${t}`,{method:"DELETE"});if(!a.ok)throw new Error(await Ae(a,"Failed to delete workflow schedule"))},fN=["disabled","loggedOut","connecting","online","reconnecting","revoked"],mN=(t,a)=>typeof t=="string"&&fN.includes(t)?t:a?"online":"disabled",F0=t=>({enabled:t.enabled===!0,loggedIn:t.loggedIn===!0,gatewayUrl:t.gatewayUrl??null,connected:t.connected===!0,connection:mN(t.connection,t.connected===!0)}),pN=t=>({deviceId:t.id,name:t.name,lastActive:t.last_active,createdAt:t.created_at,revoked:t.revoked_at!==null}),hN=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}),uf=async()=>{const t=await ge("/api/remote/status");if(!t.ok)throw new Error(await Ae(t,"Failed to load remote status"));return F0(await t.json())},gN=async t=>{const a=await ge("/api/remote/enabled",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:t})});if(!a.ok)throw new Error(await Ae(a,"Failed to update remote access"));return F0(await a.json())},vN=async()=>{const t=await ge("/api/remote/pairings",{method:"POST"});if(!t.ok)throw new Error(await Ae(t,"Failed to start pairing"));return await t.json()},xy=async()=>{const t=await ge("/api/remote/pairings/pending");if(!t.ok)throw new Error(await Ae(t,"Failed to load pending pairing"));const o=(await t.json())[0];return o?{...o}:null},yN=async t=>{const a=await ge(`/api/remote/pairings/${t}/confirm`,{method:"POST"});if(!a.ok)throw new Error(await Ae(a,"Failed to confirm pairing"))},bN=async t=>{const a=await ge(`/api/remote/pairings/${t}/reject`,{method:"POST"});if(!a.ok)throw new Error(await Ae(a,"Failed to reject pairing"))},K0=async()=>{const t=await ge("/api/remote/devices");if(!t.ok)throw new Error(await Ae(t,"Failed to load devices"));return(await t.json()).map(pN)},wN=async t=>{const a=await ge(`/api/remote/devices/${t}/revoke`,{method:"POST"});if(!a.ok)throw new Error(await Ae(a,"Failed to revoke device"))},xN=async(t=100)=>{const a=await ge(`/api/remote/audit?limit=${t}`);if(!a.ok)throw new Error(await Ae(a,"Failed to load remote activity"));return(await a.json()).map(hN)},kN=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,df=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}),SN=t=>({attention:(t.attention??[]).map(kN),generatedAt:t.generated_at,recentActivity:t.recent_activity.map(a=>({...df(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?df(a.current_dispatch):null,id:a.id,latestReport:a.latest_report?df(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}),EN=async(t,a)=>{const o=await ge(`/api/ui/workspaces/${t}/action-center`,a);if(!o.ok)throw new Error(await Ae(o,"Failed to load action center"));return SN(await o.json())},CN=async(t,a)=>{const o=await ge(`/api/workspaces/${t}/recap`,a);if(!o.ok)throw new Error(await Ae(o,"Failed to load team recap"));const i=await o.json();return{generatedAt:i.generated_at,markdown:i.markdown}},TN=async()=>{const t=await ge("/api/diagnostics/support-bundle");if(!t.ok)throw new Error(await Ae(t,"Failed to load diagnostics"));return await t.json()},NN=async()=>{const t=await ge("/api/diagnostics/retention");if(!t.ok)throw new Error(await Ae(t,"Failed to load retention diagnostics"));return await t.json()},Y0=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")},V0=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 Y0(await t)},ky="(max-width: 767px)",$0=b.createContext({mode:"wide"}),ff={mode:"wide"},jN={mode:"mobile"},AN=(t=typeof window<"u"?window.matchMedia.bind(window):void 0)=>{const a=i=>{if(!t)return()=>{};const l=t(ky);return l.addEventListener?.("change",i),()=>l.removeEventListener?.("change",i)},o=()=>t&&t(ky).matches?jN:ff;return b.useSyncExternalStore(a,o,()=>ff)},_N=({children:t,value:a})=>{const o=AN();return c.jsx($0.Provider,{value:a??o,children:t})},G0=()=>b.useContext($0),wt=()=>G0().mode==="mobile",RN=["top","right","bottom","left"],Va=Math.min,Zt=Math.max,Gl=Math.round,Al=Math.floor,zn=t=>({x:t,y:t}),ON={left:"right",right:"left",bottom:"top",top:"bottom"};function Pf(t,a,o){return Zt(t,Va(a,o))}function sa(t,a){return typeof t=="function"?t(a):t}function ia(t){return t.split("-")[0]}function Lo(t){return t.split("-")[1]}function _m(t){return t==="x"?"y":"x"}function Rm(t){return t==="y"?"height":"width"}function Ln(t){const a=t[0];return a==="t"||a==="b"?"y":"x"}function Om(t){return _m(Ln(t))}function DN(t,a,o){o===void 0&&(o=!1);const i=Lo(t),l=Om(t),u=Rm(l);let f=l==="x"?i===(o?"end":"start")?"right":"left":i==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(f=Xl(f)),[f,Xl(f)]}function MN(t){const a=Xl(t);return[Ff(t),a,Ff(a)]}function Ff(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Sy=["left","right"],Ey=["right","left"],LN=["top","bottom"],zN=["bottom","top"];function HN(t,a,o){switch(t){case"top":case"bottom":return o?a?Ey:Sy:a?Sy:Ey;case"left":case"right":return a?LN:zN;default:return[]}}function BN(t,a,o,i){const l=Lo(t);let u=HN(ia(t),o==="start",i);return l&&(u=u.map(f=>f+"-"+l),a&&(u=u.concat(u.map(Ff)))),u}function Xl(t){const a=ia(t);return ON[a]+t.slice(a.length)}function UN(t){return{top:0,right:0,bottom:0,left:0,...t}}function X0(t){return typeof t!="number"?UN(t):{top:t,right:t,bottom:t,left:t}}function Zl(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 Cy(t,a,o){let{reference:i,floating:l}=t;const u=Ln(a),f=Om(a),m=Rm(f),g=ia(a),p=u==="y",y=i.x+i.width/2-l.width/2,v=i.y+i.height/2-l.height/2,k=i[m]/2-l[m]/2;let S;switch(g){case"top":S={x:y,y:i.y-l.height};break;case"bottom":S={x:y,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(Lo(a)){case"start":S[f]-=k*(o&&p?-1:1);break;case"end":S[f]+=k*(o&&p?-1:1);break}return S}async function WN(t,a){var o;a===void 0&&(a={});const{x:i,y:l,platform:u,rects:f,elements:m,strategy:g}=t,{boundary:p="clippingAncestors",rootBoundary:y="viewport",elementContext:v="floating",altBoundary:k=!1,padding:S=0}=sa(a,t),T=X0(S),E=m[k?v==="floating"?"reference":"floating":v],C=Zl(await u.getClippingRect({element:(o=await(u.isElement==null?void 0:u.isElement(E)))==null||o?E:E.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(m.floating)),boundary:p,rootBoundary:y,strategy:g})),j=v==="floating"?{x:i,y:l,width:f.floating.width,height:f.floating.height}:f.reference,_=await(u.getOffsetParent==null?void 0:u.getOffsetParent(m.floating)),N=await(u.isElement==null?void 0:u.isElement(_))?await(u.getScale==null?void 0:u.getScale(_))||{x:1,y:1}:{x:1,y:1},O=Zl(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:j,offsetParent:_,strategy:g}):j);return{top:(C.top-O.top+T.top)/N.y,bottom:(O.bottom-C.bottom+T.bottom)/N.y,left:(C.left-O.left+T.left)/N.x,right:(O.right-C.right+T.right)/N.x}}const IN=50,qN=async(t,a,o)=>{const{placement:i="bottom",strategy:l="absolute",middleware:u=[],platform:f}=o,m=f.detectOverflow?f:{...f,detectOverflow:WN},g=await(f.isRTL==null?void 0:f.isRTL(a));let p=await f.getElementRects({reference:t,floating:a,strategy:l}),{x:y,y:v}=Cy(p,i,g),k=i,S=0;const T={};for(let w=0;w<u.length;w++){const E=u[w];if(!E)continue;const{name:C,fn:j}=E,{x:_,y:N,data:O,reset:M}=await j({x:y,y:v,initialPlacement:i,placement:k,strategy:l,middlewareData:T,rects:p,platform:m,elements:{reference:t,floating:a}});y=_??y,v=N??v,T[C]={...T[C],...O},M&&S<IN&&(S++,typeof M=="object"&&(M.placement&&(k=M.placement),M.rects&&(p=M.rects===!0?await f.getElementRects({reference:t,floating:a,strategy:l}):M.rects),{x:y,y:v}=Cy(p,k,g)),w=-1)}return{x:y,y:v,placement:k,strategy:l,middlewareData:T}},PN=t=>({name:"arrow",options:t,async fn(a){const{x:o,y:i,placement:l,rects:u,platform:f,elements:m,middlewareData:g}=a,{element:p,padding:y=0}=sa(t,a)||{};if(p==null)return{};const v=X0(y),k={x:o,y:i},S=Om(l),T=Rm(S),w=await f.getDimensions(p),E=S==="y",C=E?"top":"left",j=E?"bottom":"right",_=E?"clientHeight":"clientWidth",N=u.reference[T]+u.reference[S]-k[S]-u.floating[T],O=k[S]-u.reference[S],M=await(f.getOffsetParent==null?void 0:f.getOffsetParent(p));let L=M?M[_]:0;(!L||!await(f.isElement==null?void 0:f.isElement(M)))&&(L=m.floating[_]||u.floating[T]);const U=N/2-O/2,q=L/2-w[T]/2-1,ae=Va(v[C],q),ee=Va(v[j],q),F=ae,J=L-w[T]-ee,X=L/2-w[T]/2+U,V=Pf(F,X,J),D=!g.arrow&&Lo(l)!=null&&X!==V&&u.reference[T]/2-(X<F?ae:ee)-w[T]/2<0,P=D?X<F?X-F:X-J:0;return{[S]:k[S]+P,data:{[S]:V,centerOffset:X-V-P,...D&&{alignmentOffset:P}},reset:D}}}),FN=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:m,platform:g,elements:p}=a,{mainAxis:y=!0,crossAxis:v=!0,fallbackPlacements:k,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:w=!0,...E}=sa(t,a);if((o=u.arrow)!=null&&o.alignmentOffset)return{};const C=ia(l),j=Ln(m),_=ia(m)===m,N=await(g.isRTL==null?void 0:g.isRTL(p.floating)),O=k||(_||!w?[Xl(m)]:MN(m)),M=T!=="none";!k&&M&&O.push(...BN(m,w,T,N));const L=[m,...O],U=await g.detectOverflow(a,E),q=[];let ae=((i=u.flip)==null?void 0:i.overflows)||[];if(y&&q.push(U[C]),v){const X=DN(l,f,N);q.push(U[X[0]],U[X[1]])}if(ae=[...ae,{placement:l,overflows:q}],!q.every(X=>X<=0)){var ee,F;const X=(((ee=u.flip)==null?void 0:ee.index)||0)+1,V=L[X];if(V&&(!(v==="alignment"?j!==Ln(V):!1)||ae.every(I=>Ln(I.placement)===j?I.overflows[0]>0:!0)))return{data:{index:X,overflows:ae},reset:{placement:V}};let D=(F=ae.filter(P=>P.overflows[0]<=0).sort((P,I)=>P.overflows[1]-I.overflows[1])[0])==null?void 0:F.placement;if(!D)switch(S){case"bestFit":{var J;const P=(J=ae.filter(I=>{if(M){const $=Ln(I.placement);return $===j||$==="y"}return!0}).map(I=>[I.placement,I.overflows.filter($=>$>0).reduce(($,Z)=>$+Z,0)]).sort((I,$)=>I[1]-$[1])[0])==null?void 0:J[0];P&&(D=P);break}case"initialPlacement":D=m;break}if(l!==D)return{reset:{placement:D}}}return{}}}};function Ty(t,a){return{top:t.top-a.height,right:t.right-a.width,bottom:t.bottom-a.height,left:t.left-a.width}}function Ny(t){return RN.some(a=>t[a]>=0)}const KN=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(a){const{rects:o,platform:i}=a,{strategy:l="referenceHidden",...u}=sa(t,a);switch(l){case"referenceHidden":{const f=await i.detectOverflow(a,{...u,elementContext:"reference"}),m=Ty(f,o.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:Ny(m)}}}case"escaped":{const f=await i.detectOverflow(a,{...u,altBoundary:!0}),m=Ty(f,o.floating);return{data:{escapedOffsets:m,escaped:Ny(m)}}}default:return{}}}}},Z0=new Set(["left","top"]);async function YN(t,a){const{placement:o,platform:i,elements:l}=t,u=await(i.isRTL==null?void 0:i.isRTL(l.floating)),f=ia(o),m=Lo(o),g=Ln(o)==="y",p=Z0.has(f)?-1:1,y=u&&g?-1:1,v=sa(a,t);let{mainAxis:k,crossAxis:S,alignmentAxis:T}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return m&&typeof T=="number"&&(S=m==="end"?T*-1:T),g?{x:S*y,y:k*p}:{x:k*p,y:S*y}}const VN=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:m}=a,g=await YN(a,t);return f===((o=m.offset)==null?void 0:o.placement)&&(i=m.arrow)!=null&&i.alignmentOffset?{}:{x:l+g.x,y:u+g.y,data:{...g,placement:f}}}}},$N=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:m=!1,limiter:g={fn:C=>{let{x:j,y:_}=C;return{x:j,y:_}}},...p}=sa(t,a),y={x:o,y:i},v=await u.detectOverflow(a,p),k=Ln(ia(l)),S=_m(k);let T=y[S],w=y[k];if(f){const C=S==="y"?"top":"left",j=S==="y"?"bottom":"right",_=T+v[C],N=T-v[j];T=Pf(_,T,N)}if(m){const C=k==="y"?"top":"left",j=k==="y"?"bottom":"right",_=w+v[C],N=w-v[j];w=Pf(_,w,N)}const E=g.fn({...a,[S]:T,[k]:w});return{...E,data:{x:E.x-o,y:E.y-i,enabled:{[S]:f,[k]:m}}}}}},GN=function(t){return t===void 0&&(t={}),{options:t,fn(a){const{x:o,y:i,placement:l,rects:u,middlewareData:f}=a,{offset:m=0,mainAxis:g=!0,crossAxis:p=!0}=sa(t,a),y={x:o,y:i},v=Ln(l),k=_m(v);let S=y[k],T=y[v];const w=sa(m,a),E=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(g){const _=k==="y"?"height":"width",N=u.reference[k]-u.floating[_]+E.mainAxis,O=u.reference[k]+u.reference[_]-E.mainAxis;S<N?S=N:S>O&&(S=O)}if(p){var C,j;const _=k==="y"?"width":"height",N=Z0.has(ia(l)),O=u.reference[v]-u.floating[_]+(N&&((C=f.offset)==null?void 0:C[v])||0)+(N?0:E.crossAxis),M=u.reference[v]+u.reference[_]+(N?0:((j=f.offset)==null?void 0:j[v])||0)-(N?E.crossAxis:0);T<O?T=O:T>M&&(T=M)}return{[k]:S,[v]:T}}}},XN=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:m}=a,{apply:g=()=>{},...p}=sa(t,a),y=await f.detectOverflow(a,p),v=ia(l),k=Lo(l),S=Ln(l)==="y",{width:T,height:w}=u.floating;let E,C;v==="top"||v==="bottom"?(E=v,C=k===(await(f.isRTL==null?void 0:f.isRTL(m.floating))?"start":"end")?"left":"right"):(C=v,E=k==="end"?"top":"bottom");const j=w-y.top-y.bottom,_=T-y.left-y.right,N=Va(w-y[E],j),O=Va(T-y[C],_),M=!a.middlewareData.shift;let L=N,U=O;if((o=a.middlewareData.shift)!=null&&o.enabled.x&&(U=_),(i=a.middlewareData.shift)!=null&&i.enabled.y&&(L=j),M&&!k){const ae=Zt(y.left,0),ee=Zt(y.right,0),F=Zt(y.top,0),J=Zt(y.bottom,0);S?U=T-2*(ae!==0||ee!==0?ae+ee:Zt(y.left,y.right)):L=w-2*(F!==0||J!==0?F+J:Zt(y.top,y.bottom))}await g({...a,availableWidth:U,availableHeight:L});const q=await f.getDimensions(m.floating);return T!==q.width||w!==q.height?{reset:{rects:!0}}:{}}}};function xc(){return typeof window<"u"}function zo(t){return Q0(t)?(t.nodeName||"").toLowerCase():"#document"}function Jt(t){var a;return(t==null||(a=t.ownerDocument)==null?void 0:a.defaultView)||window}function Un(t){var a;return(a=(Q0(t)?t.ownerDocument:t.document)||window.document)==null?void 0:a.documentElement}function Q0(t){return xc()?t instanceof Node||t instanceof Jt(t).Node:!1}function kn(t){return xc()?t instanceof Element||t instanceof Jt(t).Element:!1}function ca(t){return xc()?t instanceof HTMLElement||t instanceof Jt(t).HTMLElement:!1}function jy(t){return!xc()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Jt(t).ShadowRoot}function ti(t){const{overflow:a,overflowX:o,overflowY:i,display:l}=Sn(t);return/auto|scroll|overlay|hidden|clip/.test(a+i+o)&&l!=="inline"&&l!=="contents"}function ZN(t){return/^(table|td|th)$/.test(zo(t))}function kc(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const QN=/transform|translate|scale|rotate|perspective|filter/,JN=/paint|layout|strict|content/,gr=t=>!!t&&t!=="none";let mf;function Dm(t){const a=kn(t)?Sn(t):t;return gr(a.transform)||gr(a.translate)||gr(a.scale)||gr(a.rotate)||gr(a.perspective)||!Mm()&&(gr(a.backdropFilter)||gr(a.filter))||QN.test(a.willChange||"")||JN.test(a.contain||"")}function ej(t){let a=$a(t);for(;ca(a)&&!So(a);){if(Dm(a))return a;if(kc(a))return null;a=$a(a)}return null}function Mm(){return mf==null&&(mf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),mf}function So(t){return/^(html|body|#document)$/.test(zo(t))}function Sn(t){return Jt(t).getComputedStyle(t)}function Sc(t){return kn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function $a(t){if(zo(t)==="html")return t;const a=t.assignedSlot||t.parentNode||jy(t)&&t.host||Un(t);return jy(a)?a.host:a}function J0(t){const a=$a(t);return So(a)?t.ownerDocument?t.ownerDocument.body:t.body:ca(a)&&ti(a)?a:J0(a)}function Ks(t,a,o){var i;a===void 0&&(a=[]),o===void 0&&(o=!0);const l=J0(t),u=l===((i=t.ownerDocument)==null?void 0:i.body),f=Jt(l);if(u){const m=Kf(f);return a.concat(f,f.visualViewport||[],ti(l)?l:[],m&&o?Ks(m):[])}else return a.concat(l,Ks(l,[],o))}function Kf(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ew(t){const a=Sn(t);let o=parseFloat(a.width)||0,i=parseFloat(a.height)||0;const l=ca(t),u=l?t.offsetWidth:o,f=l?t.offsetHeight:i,m=Gl(o)!==u||Gl(i)!==f;return m&&(o=u,i=f),{width:o,height:i,$:m}}function Lm(t){return kn(t)?t:t.contextElement}function yo(t){const a=Lm(t);if(!ca(a))return zn(1);const o=a.getBoundingClientRect(),{width:i,height:l,$:u}=ew(a);let f=(u?Gl(o.width):o.width)/i,m=(u?Gl(o.height):o.height)/l;return(!f||!Number.isFinite(f))&&(f=1),(!m||!Number.isFinite(m))&&(m=1),{x:f,y:m}}const tj=zn(0);function tw(t){const a=Jt(t);return!Mm()||!a.visualViewport?tj:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function nj(t,a,o){return a===void 0&&(a=!1),!o||a&&o!==Jt(t)?!1:a}function Er(t,a,o,i){a===void 0&&(a=!1),o===void 0&&(o=!1);const l=t.getBoundingClientRect(),u=Lm(t);let f=zn(1);a&&(i?kn(i)&&(f=yo(i)):f=yo(t));const m=nj(u,o,i)?tw(u):zn(0);let g=(l.left+m.x)/f.x,p=(l.top+m.y)/f.y,y=l.width/f.x,v=l.height/f.y;if(u){const k=Jt(u),S=i&&kn(i)?Jt(i):i;let T=k,w=Kf(T);for(;w&&i&&S!==T;){const E=yo(w),C=w.getBoundingClientRect(),j=Sn(w),_=C.left+(w.clientLeft+parseFloat(j.paddingLeft))*E.x,N=C.top+(w.clientTop+parseFloat(j.paddingTop))*E.y;g*=E.x,p*=E.y,y*=E.x,v*=E.y,g+=_,p+=N,T=Jt(w),w=Kf(T)}}return Zl({width:y,height:v,x:g,y:p})}function Ec(t,a){const o=Sc(t).scrollLeft;return a?a.left+o:Er(Un(t)).left+o}function nw(t,a){const o=t.getBoundingClientRect(),i=o.left+a.scrollLeft-Ec(t,o),l=o.top+a.scrollTop;return{x:i,y:l}}function aj(t){let{elements:a,rect:o,offsetParent:i,strategy:l}=t;const u=l==="fixed",f=Un(i),m=a?kc(a.floating):!1;if(i===f||m&&u)return o;let g={scrollLeft:0,scrollTop:0},p=zn(1);const y=zn(0),v=ca(i);if((v||!v&&!u)&&((zo(i)!=="body"||ti(f))&&(g=Sc(i)),v)){const S=Er(i);p=yo(i),y.x=S.x+i.clientLeft,y.y=S.y+i.clientTop}const k=f&&!v&&!u?nw(f,g):zn(0);return{width:o.width*p.x,height:o.height*p.y,x:o.x*p.x-g.scrollLeft*p.x+y.x+k.x,y:o.y*p.y-g.scrollTop*p.y+y.y+k.y}}function rj(t){return Array.from(t.getClientRects())}function oj(t){const a=Un(t),o=Sc(t),i=t.ownerDocument.body,l=Zt(a.scrollWidth,a.clientWidth,i.scrollWidth,i.clientWidth),u=Zt(a.scrollHeight,a.clientHeight,i.scrollHeight,i.clientHeight);let f=-o.scrollLeft+Ec(t);const m=-o.scrollTop;return Sn(i).direction==="rtl"&&(f+=Zt(a.clientWidth,i.clientWidth)-l),{width:l,height:u,x:f,y:m}}const Ay=25;function sj(t,a){const o=Jt(t),i=Un(t),l=o.visualViewport;let u=i.clientWidth,f=i.clientHeight,m=0,g=0;if(l){u=l.width,f=l.height;const y=Mm();(!y||y&&a==="fixed")&&(m=l.offsetLeft,g=l.offsetTop)}const p=Ec(i);if(p<=0){const y=i.ownerDocument,v=y.body,k=getComputedStyle(v),S=y.compatMode==="CSS1Compat"&&parseFloat(k.marginLeft)+parseFloat(k.marginRight)||0,T=Math.abs(i.clientWidth-v.clientWidth-S);T<=Ay&&(u-=T)}else p<=Ay&&(u+=p);return{width:u,height:f,x:m,y:g}}function ij(t,a){const o=Er(t,!0,a==="fixed"),i=o.top+t.clientTop,l=o.left+t.clientLeft,u=ca(t)?yo(t):zn(1),f=t.clientWidth*u.x,m=t.clientHeight*u.y,g=l*u.x,p=i*u.y;return{width:f,height:m,x:g,y:p}}function _y(t,a,o){let i;if(a==="viewport")i=sj(t,o);else if(a==="document")i=oj(Un(t));else if(kn(a))i=ij(a,o);else{const l=tw(t);i={x:a.x-l.x,y:a.y-l.y,width:a.width,height:a.height}}return Zl(i)}function aw(t,a){const o=$a(t);return o===a||!kn(o)||So(o)?!1:Sn(o).position==="fixed"||aw(o,a)}function lj(t,a){const o=a.get(t);if(o)return o;let i=Ks(t,[],!1).filter(m=>kn(m)&&zo(m)!=="body"),l=null;const u=Sn(t).position==="fixed";let f=u?$a(t):t;for(;kn(f)&&!So(f);){const m=Sn(f),g=Dm(f);!g&&m.position==="fixed"&&(l=null),(u?!g&&!l:!g&&m.position==="static"&&!!l&&(l.position==="absolute"||l.position==="fixed")||ti(f)&&!g&&aw(t,f))?i=i.filter(y=>y!==f):l=m,f=$a(f)}return a.set(t,i),i}function cj(t){let{element:a,boundary:o,rootBoundary:i,strategy:l}=t;const f=[...o==="clippingAncestors"?kc(a)?[]:lj(a,this._c):[].concat(o),i],m=_y(a,f[0],l);let g=m.top,p=m.right,y=m.bottom,v=m.left;for(let k=1;k<f.length;k++){const S=_y(a,f[k],l);g=Zt(S.top,g),p=Va(S.right,p),y=Va(S.bottom,y),v=Zt(S.left,v)}return{width:p-v,height:y-g,x:v,y:g}}function uj(t){const{width:a,height:o}=ew(t);return{width:a,height:o}}function dj(t,a,o){const i=ca(a),l=Un(a),u=o==="fixed",f=Er(t,!0,u,a);let m={scrollLeft:0,scrollTop:0};const g=zn(0);function p(){g.x=Ec(l)}if(i||!i&&!u)if((zo(a)!=="body"||ti(l))&&(m=Sc(a)),i){const S=Er(a,!0,u,a);g.x=S.x+a.clientLeft,g.y=S.y+a.clientTop}else l&&p();u&&!i&&l&&p();const y=l&&!i&&!u?nw(l,m):zn(0),v=f.left+m.scrollLeft-g.x-y.x,k=f.top+m.scrollTop-g.y-y.y;return{x:v,y:k,width:f.width,height:f.height}}function pf(t){return Sn(t).position==="static"}function Ry(t,a){if(!ca(t)||Sn(t).position==="fixed")return null;if(a)return a(t);let o=t.offsetParent;return Un(t)===o&&(o=o.ownerDocument.body),o}function rw(t,a){const o=Jt(t);if(kc(t))return o;if(!ca(t)){let l=$a(t);for(;l&&!So(l);){if(kn(l)&&!pf(l))return l;l=$a(l)}return o}let i=Ry(t,a);for(;i&&ZN(i)&&pf(i);)i=Ry(i,a);return i&&So(i)&&pf(i)&&!Dm(i)?o:i||ej(t)||o}const fj=async function(t){const a=this.getOffsetParent||rw,o=this.getDimensions,i=await o(t.floating);return{reference:dj(t.reference,await a(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function mj(t){return Sn(t).direction==="rtl"}const pj={convertOffsetParentRelativeRectToViewportRelativeRect:aj,getDocumentElement:Un,getClippingRect:cj,getOffsetParent:rw,getElementRects:fj,getClientRects:rj,getDimensions:uj,getScale:yo,isElement:kn,isRTL:mj};function ow(t,a){return t.x===a.x&&t.y===a.y&&t.width===a.width&&t.height===a.height}function hj(t,a){let o=null,i;const l=Un(t);function u(){var m;clearTimeout(i),(m=o)==null||m.disconnect(),o=null}function f(m,g){m===void 0&&(m=!1),g===void 0&&(g=1),u();const p=t.getBoundingClientRect(),{left:y,top:v,width:k,height:S}=p;if(m||a(),!k||!S)return;const T=Al(v),w=Al(l.clientWidth-(y+k)),E=Al(l.clientHeight-(v+S)),C=Al(y),_={rootMargin:-T+"px "+-w+"px "+-E+"px "+-C+"px",threshold:Zt(0,Va(1,g))||1};let N=!0;function O(M){const L=M[0].intersectionRatio;if(L!==g){if(!N)return f();L?f(!1,L):i=setTimeout(()=>{f(!1,1e-7)},1e3)}L===1&&!ow(p,t.getBoundingClientRect())&&f(),N=!1}try{o=new IntersectionObserver(O,{..._,root:l.ownerDocument})}catch{o=new IntersectionObserver(O,_)}o.observe(t)}return f(!0),u}function gj(t,a,o,i){i===void 0&&(i={});const{ancestorScroll:l=!0,ancestorResize:u=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:g=!1}=i,p=Lm(t),y=l||u?[...p?Ks(p):[],...a?Ks(a):[]]:[];y.forEach(C=>{l&&C.addEventListener("scroll",o,{passive:!0}),u&&C.addEventListener("resize",o)});const v=p&&m?hj(p,o):null;let k=-1,S=null;f&&(S=new ResizeObserver(C=>{let[j]=C;j&&j.target===p&&S&&a&&(S.unobserve(a),cancelAnimationFrame(k),k=requestAnimationFrame(()=>{var _;(_=S)==null||_.observe(a)})),o()}),p&&!g&&S.observe(p),a&&S.observe(a));let T,w=g?Er(t):null;g&&E();function E(){const C=Er(t);w&&!ow(w,C)&&o(),w=C,T=requestAnimationFrame(E)}return o(),()=>{var C;y.forEach(j=>{l&&j.removeEventListener("scroll",o),u&&j.removeEventListener("resize",o)}),v?.(),(C=S)==null||C.disconnect(),S=null,g&&cancelAnimationFrame(T)}}const vj=VN,yj=$N,bj=FN,wj=XN,xj=KN,Oy=PN,kj=GN,Sj=(t,a,o)=>{const i=new Map,l={platform:pj,...o},u={...l.platform,_c:i};return qN(t,a,{...l,platform:u})};var Ej=typeof document<"u",Cj=function(){},Hl=Ej?b.useLayoutEffect:Cj;function Ql(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(!Ql(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)&&!Ql(t[u],a[u]))return!1}return!0}return t!==t&&a!==a}function sw(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Dy(t,a){const o=sw(t);return Math.round(a*o)/o}function hf(t){const a=b.useRef(t);return Hl(()=>{a.current=t}),a}function Tj(t){t===void 0&&(t={});const{placement:a="bottom",strategy:o="absolute",middleware:i=[],platform:l,elements:{reference:u,floating:f}={},transform:m=!0,whileElementsMounted:g,open:p}=t,[y,v]=b.useState({x:0,y:0,strategy:o,placement:a,middlewareData:{},isPositioned:!1}),[k,S]=b.useState(i);Ql(k,i)||S(i);const[T,w]=b.useState(null),[E,C]=b.useState(null),j=b.useCallback(I=>{I!==M.current&&(M.current=I,w(I))},[]),_=b.useCallback(I=>{I!==L.current&&(L.current=I,C(I))},[]),N=u||T,O=f||E,M=b.useRef(null),L=b.useRef(null),U=b.useRef(y),q=g!=null,ae=hf(g),ee=hf(l),F=hf(p),J=b.useCallback(()=>{if(!M.current||!L.current)return;const I={placement:a,strategy:o,middleware:k};ee.current&&(I.platform=ee.current),Sj(M.current,L.current,I).then($=>{const Z={...$,isPositioned:F.current!==!1};X.current&&!Ql(U.current,Z)&&(U.current=Z,gc.flushSync(()=>{v(Z)}))})},[k,a,o,ee,F]);Hl(()=>{p===!1&&U.current.isPositioned&&(U.current.isPositioned=!1,v(I=>({...I,isPositioned:!1})))},[p]);const X=b.useRef(!1);Hl(()=>(X.current=!0,()=>{X.current=!1}),[]),Hl(()=>{if(N&&(M.current=N),O&&(L.current=O),N&&O){if(ae.current)return ae.current(N,O,J);J()}},[N,O,J,ae,q]);const V=b.useMemo(()=>({reference:M,floating:L,setReference:j,setFloating:_}),[j,_]),D=b.useMemo(()=>({reference:N,floating:O}),[N,O]),P=b.useMemo(()=>{const I={position:o,left:0,top:0};if(!D.floating)return I;const $=Dy(D.floating,y.x),Z=Dy(D.floating,y.y);return m?{...I,transform:"translate("+$+"px, "+Z+"px)",...sw(D.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:$,top:Z}},[o,m,D.floating,y.x,y.y]);return b.useMemo(()=>({...y,update:J,refs:V,elements:D,floatingStyles:P}),[y,J,V,D,P])}const Nj=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?Oy({element:i.current,padding:l}).fn(o):{}:i?Oy({element:i,padding:l}).fn(o):{}}}},jj=(t,a)=>{const o=vj(t);return{name:o.name,fn:o.fn,options:[t,a]}},Aj=(t,a)=>{const o=yj(t);return{name:o.name,fn:o.fn,options:[t,a]}},_j=(t,a)=>({fn:kj(t).fn,options:[t,a]}),Rj=(t,a)=>{const o=bj(t);return{name:o.name,fn:o.fn,options:[t,a]}},Oj=(t,a)=>{const o=wj(t);return{name:o.name,fn:o.fn,options:[t,a]}},Dj=(t,a)=>{const o=xj(t);return{name:o.name,fn:o.fn,options:[t,a]}},Mj=(t,a)=>{const o=Nj(t);return{name:o.name,fn:o.fn,options:[t,a]}};var Lj="Arrow",iw=b.forwardRef((t,a)=>{const{children:o,width:i=10,height:l=5,...u}=t;return c.jsx(Ut.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"})})});iw.displayName=Lj;var zj=iw;function Hj(t){const[a,o]=b.useState(void 0);return Ya(()=>{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,m;if("borderBoxSize"in u){const g=u.borderBoxSize,p=Array.isArray(g)?g[0]:g;f=p.inlineSize,m=p.blockSize}else f=t.offsetWidth,m=t.offsetHeight;o({width:f,height:m})});return i.observe(t,{box:"border-box"}),()=>i.unobserve(t)}else o(void 0)},[t]),a}var zm="Popper",[lw,cw]=Sm(zm),[Bj,uw]=lw(zm),dw=t=>{const{__scopePopper:a,children:o}=t,[i,l]=b.useState(null);return c.jsx(Bj,{scope:a,anchor:i,onAnchorChange:l,children:o})};dw.displayName=zm;var fw="PopperAnchor",mw=b.forwardRef((t,a)=>{const{__scopePopper:o,virtualRef:i,...l}=t,u=uw(fw,o),f=b.useRef(null),m=En(a,f),g=b.useRef(null);return b.useEffect(()=>{const p=g.current;g.current=i?.current||f.current,p!==g.current&&u.onAnchorChange(g.current)}),i?null:c.jsx(Ut.div,{...l,ref:m})});mw.displayName=fw;var Hm="PopperContent",[Uj,Wj]=lw(Hm),pw=b.forwardRef((t,a)=>{const{__scopePopper:o,side:i="bottom",sideOffset:l=0,align:u="center",alignOffset:f=0,arrowPadding:m=0,avoidCollisions:g=!0,collisionBoundary:p=[],collisionPadding:y=0,sticky:v="partial",hideWhenDetached:k=!1,updatePositionStrategy:S="optimized",onPlaced:T,...w}=t,E=uw(Hm,o),[C,j]=b.useState(null),_=En(a,ue=>j(ue)),[N,O]=b.useState(null),M=Hj(N),L=M?.width??0,U=M?.height??0,q=i+(u!=="center"?"-"+u:""),ae=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},ee=Array.isArray(p)?p:[p],F=ee.length>0,J={padding:ae,boundary:ee.filter(qj),altBoundary:F},{refs:X,floatingStyles:V,placement:D,isPositioned:P,middlewareData:I}=Tj({strategy:"fixed",placement:q,whileElementsMounted:(...ue)=>gj(...ue,{animationFrame:S==="always"}),elements:{reference:E.anchor},middleware:[jj({mainAxis:l+U,alignmentAxis:f}),g&&Aj({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?_j():void 0,...J}),g&&Rj({...J}),Oj({...J,apply:({elements:ue,rects:ie,availableWidth:le,availableHeight:ce})=>{const{width:me,height:Te}=ie.reference,Ne=ue.floating.style;Ne.setProperty("--radix-popper-available-width",`${le}px`),Ne.setProperty("--radix-popper-available-height",`${ce}px`),Ne.setProperty("--radix-popper-anchor-width",`${me}px`),Ne.setProperty("--radix-popper-anchor-height",`${Te}px`)}}),N&&Mj({element:N,padding:m}),Pj({arrowWidth:L,arrowHeight:U}),k&&Dj({strategy:"referenceHidden",...J})]}),[$,Z]=vw(D),R=xo(T);Ya(()=>{P&&R?.()},[P,R]);const B=I.arrow?.x,re=I.arrow?.y,ne=I.arrow?.centerOffset!==0,[de,fe]=b.useState();return Ya(()=>{C&&fe(window.getComputedStyle(C).zIndex)},[C]),c.jsx("div",{ref:X.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:P?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:c.jsx(Uj,{scope:o,placedSide:$,onArrowChange:O,arrowX:B,arrowY:re,shouldHideArrow:ne,children:c.jsx(Ut.div,{"data-side":$,"data-align":Z,...w,ref:_,style:{...w.style,animation:P?void 0:"none"}})})})});pw.displayName=Hm;var hw="PopperArrow",Ij={top:"bottom",right:"left",bottom:"top",left:"right"},gw=b.forwardRef(function(a,o){const{__scopePopper:i,...l}=a,u=Wj(hw,i),f=Ij[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(zj,{...l,ref:o,style:{...l.style,display:"block"}})})});gw.displayName=hw;function qj(t){return t!==null}var Pj=t=>({name:"transformOrigin",options:t,fn(a){const{placement:o,rects:i,middlewareData:l}=a,f=l.arrow?.centerOffset!==0,m=f?0:t.arrowWidth,g=f?0:t.arrowHeight,[p,y]=vw(o),v={start:"0%",center:"50%",end:"100%"}[y],k=(l.arrow?.x??0)+m/2,S=(l.arrow?.y??0)+g/2;let T="",w="";return p==="bottom"?(T=f?v:`${k}px`,w=`${-g}px`):p==="top"?(T=f?v:`${k}px`,w=`${i.floating.height+g}px`):p==="right"?(T=`${-g}px`,w=f?v:`${S}px`):p==="left"&&(T=`${i.floating.width+g}px`,w=f?v:`${S}px`),{data:{x:T,y:w}}}});function vw(t){const[a,o="center"]=t.split("-");return[a,o]}var Fj=dw,Kj=mw,Yj=pw,Vj=gw,$j=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"}),Gj="VisuallyHidden",yw=b.forwardRef((t,a)=>c.jsx(Ut.span,{...t,ref:a,style:{...$j,...t.style}}));yw.displayName=Gj;var Xj=yw,[Cc]=Sm("Tooltip",[cw]),Tc=cw(),bw="TooltipProvider",Zj=700,Yf="tooltip.open",[Qj,Bm]=Cc(bw),ww=t=>{const{__scopeTooltip:a,delayDuration:o=Zj,skipDelayDuration:i=300,disableHoverableContent:l=!1,children:u}=t,f=b.useRef(!0),m=b.useRef(!1),g=b.useRef(0);return b.useEffect(()=>{const p=g.current;return()=>window.clearTimeout(p)},[]),c.jsx(Qj,{scope:a,isOpenDelayedRef:f,delayDuration:o,onOpen:b.useCallback(()=>{window.clearTimeout(g.current),f.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>f.current=!0,i)},[i]),isPointerInTransitRef:m,onPointerInTransitChange:b.useCallback(p=>{m.current=p},[]),disableHoverableContent:l,children:u})};ww.displayName=bw;var Ys="Tooltip",[Jj,ni]=Cc(Ys),xw=t=>{const{__scopeTooltip:a,children:o,open:i,defaultOpen:l,onOpenChange:u,disableHoverableContent:f,delayDuration:m}=t,g=Bm(Ys,t.__scopeTooltip),p=Tc(a),[y,v]=b.useState(null),k=Ml(),S=b.useRef(0),T=f??g.disableHoverableContent,w=m??g.delayDuration,E=b.useRef(!1),[C,j]=r0({prop:i,defaultProp:l??!1,onChange:L=>{L?(g.onOpen(),document.dispatchEvent(new CustomEvent(Yf))):g.onClose(),u?.(L)},caller:Ys}),_=b.useMemo(()=>C?E.current?"delayed-open":"instant-open":"closed",[C]),N=b.useCallback(()=>{window.clearTimeout(S.current),S.current=0,E.current=!1,j(!0)},[j]),O=b.useCallback(()=>{window.clearTimeout(S.current),S.current=0,j(!1)},[j]),M=b.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{E.current=!0,j(!0),S.current=0},w)},[w,j]);return b.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]),c.jsx(Fj,{...p,children:c.jsx(Jj,{scope:a,contentId:k,open:C,stateAttribute:_,trigger:y,onTriggerChange:v,onTriggerEnter:b.useCallback(()=>{g.isOpenDelayedRef.current?M():N()},[g.isOpenDelayedRef,M,N]),onTriggerLeave:b.useCallback(()=>{T?O():(window.clearTimeout(S.current),S.current=0)},[O,T]),onOpen:N,onClose:O,disableHoverableContent:T,children:o})})};xw.displayName=Ys;var Vf="TooltipTrigger",kw=b.forwardRef((t,a)=>{const{__scopeTooltip:o,...i}=t,l=ni(Vf,o),u=Bm(Vf,o),f=Tc(o),m=b.useRef(null),g=En(a,m,l.onTriggerChange),p=b.useRef(!1),y=b.useRef(!1),v=b.useCallback(()=>p.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),c.jsx(Kj,{asChild:!0,...f,children:c.jsx(Ut.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...i,ref:g,onPointerMove:zt(t.onPointerMove,k=>{k.pointerType!=="touch"&&!y.current&&!u.isPointerInTransitRef.current&&(l.onTriggerEnter(),y.current=!0)}),onPointerLeave:zt(t.onPointerLeave,()=>{l.onTriggerLeave(),y.current=!1}),onPointerDown:zt(t.onPointerDown,()=>{l.open&&l.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:zt(t.onFocus,()=>{p.current||l.onOpen()}),onBlur:zt(t.onBlur,l.onClose),onClick:zt(t.onClick,l.onClose)})})});kw.displayName=Vf;var Um="TooltipPortal",[eA,tA]=Cc(Um,{forceMount:void 0}),Sw=t=>{const{__scopeTooltip:a,forceMount:o,children:i,container:l}=t,u=ni(Um,a);return c.jsx(eA,{scope:a,forceMount:o,children:c.jsx(Ao,{present:o||u.open,children:c.jsx(Cm,{asChild:!0,container:l,children:i})})})};Sw.displayName=Um;var Eo="TooltipContent",Ew=b.forwardRef((t,a)=>{const o=tA(Eo,t.__scopeTooltip),{forceMount:i=o.forceMount,side:l="top",...u}=t,f=ni(Eo,t.__scopeTooltip);return c.jsx(Ao,{present:i||f.open,children:f.disableHoverableContent?c.jsx(Cw,{side:l,...u,ref:a}):c.jsx(nA,{side:l,...u,ref:a})})}),nA=b.forwardRef((t,a)=>{const o=ni(Eo,t.__scopeTooltip),i=Bm(Eo,t.__scopeTooltip),l=b.useRef(null),u=En(a,l),[f,m]=b.useState(null),{trigger:g,onClose:p}=o,y=l.current,{onPointerInTransitChange:v}=i,k=b.useCallback(()=>{m(null),v(!1)},[v]),S=b.useCallback((T,w)=>{const E=T.currentTarget,C={x:T.clientX,y:T.clientY},j=iA(C,E.getBoundingClientRect()),_=lA(C,j),N=cA(w.getBoundingClientRect()),O=dA([..._,...N]);m(O),v(!0)},[v]);return b.useEffect(()=>()=>k(),[k]),b.useEffect(()=>{if(g&&y){const T=E=>S(E,y),w=E=>S(E,g);return g.addEventListener("pointerleave",T),y.addEventListener("pointerleave",w),()=>{g.removeEventListener("pointerleave",T),y.removeEventListener("pointerleave",w)}}},[g,y,S,k]),b.useEffect(()=>{if(f){const T=w=>{const E=w.target,C={x:w.clientX,y:w.clientY},j=g?.contains(E)||y?.contains(E),_=!uA(C,f);j?k():_&&(k(),p())};return document.addEventListener("pointermove",T),()=>document.removeEventListener("pointermove",T)}},[g,y,f,p,k]),c.jsx(Cw,{...t,ref:u})}),[aA,rA]=Cc(Ys,{isInside:!1}),oA=sC("TooltipContent"),Cw=b.forwardRef((t,a)=>{const{__scopeTooltip:o,children:i,"aria-label":l,onEscapeKeyDown:u,onPointerDownOutside:f,...m}=t,g=ni(Eo,o),p=Tc(o),{onClose:y}=g;return b.useEffect(()=>(document.addEventListener(Yf,y),()=>document.removeEventListener(Yf,y)),[y]),b.useEffect(()=>{if(g.trigger){const v=k=>{k.target?.contains(g.trigger)&&y()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[g.trigger,y]),c.jsx(Em,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:v=>v.preventDefault(),onDismiss:y,children:c.jsxs(Yj,{"data-state":g.stateAttribute,...p,...m,ref:a,style:{...m.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(oA,{children:i}),c.jsx(aA,{scope:o,isInside:!0,children:c.jsx(Xj,{id:g.contentId,role:"tooltip",children:l||i})})]})})});Ew.displayName=Eo;var Tw="TooltipArrow",sA=b.forwardRef((t,a)=>{const{__scopeTooltip:o,...i}=t,l=Tc(o);return rA(Tw,o).isInside?null:c.jsx(Vj,{...l,...i,ref:a})});sA.displayName=Tw;function iA(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 lA(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 cA(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 uA(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 m=a[u],g=a[f],p=m.x,y=m.y,v=g.x,k=g.y;y>i!=k>i&&o<(v-p)*(i-y)/(k-y)+p&&(l=!l)}return l}function dA(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),fA(a)}function fA(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 Nw=ww,mA=xw,pA=kw,hA=Sw,gA=Ew;const Qe=({children:t,label:a,side:o="top",align:i="center"})=>a?c.jsx(Nw,{delayDuration:250,skipDelayDuration:150,children:c.jsxs(mA,{children:[c.jsx(pA,{asChild:!0,children:t}),c.jsx(hA,{children:c.jsx(gA,{className:"tooltip",side:o,align:i,sideOffset:6,children:a})})]})}):c.jsx(c.Fragment,{children:t}),jw=b.createContext(null),Aw=b.createContext([]),gf=3,vA=t=>t==="success"?3e3:t==="warning"?5e3:0;let My=0;const yA=()=>(My+=1,`t-${My.toString(36)}-${Date.now().toString(36)}`),bA=({children:t})=>{const[a,o]=b.useState([]),i=b.useRef(new Map),l=b.useCallback(v=>{const k=i.current.get(v);k?.timer&&clearTimeout(k.timer),i.current.delete(v)},[]),u=b.useCallback(v=>{o(k=>k.filter(S=>S.id!==v)),l(v)},[l]),f=b.useCallback(({kind:v,message:k,durationMs:S})=>{const T=yA();o(E=>{const C=[...E,{id:T,kind:v,message:k}];if(C.length<=gf)return C;const j=C.slice(0,C.length-gf);for(const _ of j)l(_.id);return C.slice(C.length-gf)});const w=S??vA(v);if(w>0){const E=setTimeout(()=>u(T),w);i.current.set(T,{timer:E,dueAt:Date.now()+w,durationMs:w,remainingMs:w})}return T},[u,l]),m=b.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=b.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]),p=b.useCallback(v=>i.current.get(v)?.durationMs??0,[]);b.useEffect(()=>{const v=i.current;return()=>{for(const k of v.values())k.timer&&clearTimeout(k.timer);v.clear()}},[]);const y=b.useMemo(()=>({show:f,dismiss:u,pauseDismiss:m,resumeDismiss:g,getDuration:p}),[f,u,m,g,p]);return c.jsx(jw.Provider,{value:y,children:c.jsx(Aw.Provider,{value:a,children:t})})},en=()=>{const t=b.useContext(jw);if(!t)throw new Error("useToast must be used within ToastProvider");return t},wA=()=>b.useContext(Aw),xA=2e3,vf=()=>document.visibilityState==="hidden",_w=(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)})},kA={cancelled:"actionCenter.activity.cancelled",queued:"actionCenter.activity.queued",reported:"actionCenter.activity.reported",submitted:"actionCenter.activity.submitted"},Jl=(t,a)=>{const o=t.toWorkerName??a("actionCenter.unknownWorker");return a(kA[t.kind],{ago:_w(t.timestamp,a),worker:o})},Wm=t=>t.reportPreview??t.taskPreview??t.label??t.phase,Rw=t=>t.currentDispatch?.taskPreview??t.latestReport?.reportPreview??t.terminalHint??null,Ow=(t,a)=>t.currentDispatch?a("actionCenter.currentDispatch"):t.latestReport?a("actionCenter.latestReport"):t.terminalHint?a("actionCenter.terminalHint"):a("actionCenter.workerStatus"),$f=(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"}),ec=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,Dw=t=>{const[a,o]=b.useState(null),[i,l]=b.useState(!1),u=b.useCallback(async f=>EN(t,f?{signal:f}:void 0),[t]);return b.useEffect(()=>{let f=!1,m=!1,g=null,p=null;const y=async()=>{if(!(f||m||vf())){m=!0,p=new AbortController;try{const k=await u(p.signal);if(f)return;o(k),l(!1)}catch{f||l(!0)}finally{p=null,m=!1}!f&&!vf()&&(g=setTimeout(y,xA))}},v=()=>{f||vf()||(g&&(clearTimeout(g),g=null),y())};return document.addEventListener("visibilitychange",v),y(),()=>{f=!0,p?.abort(),g&&clearTimeout(g),document.removeEventListener("visibilitychange",v)}},[u]),{error:i,summary:a}},Mw=t=>{const{t:a}=we(),o=en(),[i,l]=b.useState(!1);return{copyingRecap:i,handleCopyRecap:()=>{if(i)return;l(!0);const f=CN(t).then(m=>m.markdown);V0(f).then(()=>o.show({kind:"success",message:a("actionCenter.recapCopied")})).catch(()=>o.show({kind:"error",message:a("actionCenter.recapCopyFailed")})).finally(()=>l(!1))}}},Im=t=>{const a=t?.recentActivity[0]??null,o=a?Wm(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}},SA=t=>t==="reported"?"green":t==="cancelled"?"red":t==="queued"?"orange":"accent",EA=({copyingRecap:t,onCopyRecap:a,onOpenWorker:o,summary:i})=>{const{t:l}=we(),{attention:u,evidenceWorkers:f,recentActivity:m}=Im(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(Cr,{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-${ec(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:$f(g,l),children:$f(g,l)})]})},ec(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")}),m.length>0?c.jsx("ul",{className:"flex max-h-36 flex-col gap-px overflow-auto rounded border border-bright/40 bg-0",children:m.map(g=>{const p=Wm(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:Jl(g,l)}),p?c.jsx("span",{className:"min-w-0 truncate text-ter",title:p,children:p}):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 p=Rw(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:Ow(g,l)}),p?c.jsx("span",{className:"min-w-0 flex-[1.4] truncate text-ter",title:p,children:p}):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")})]})]})},_l=({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})]})]}),CA=({copyingRecap:t,error:a,onClose:o,onCopyRecap:i,onOpenWorker:l,open:u,summary:f})=>{const{t:m}=we(),g=wt(),{attention:p,evidenceWorkers:y,latest:v,latestDetail:k,recentActivity:S}=Im(f),T=w=>{l?.(w),o()};return c.jsx(_o,{open:u,onOpenChange:w=>!w&&o(),children:c.jsxs(Ro,{children:[c.jsx(Oo,{"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(Do,{"data-testid":"action-center-drawer","aria-label":m("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(Mo,{className:"flex items-center gap-2 text-base font-semibold text-pri",children:[c.jsx(dc,{size:17,className:"text-accent","aria-hidden":!0}),m("actionCenter.title")]}),c.jsx(ei,{className:"text-xs text-ter",children:m("actionCenter.subtitle")})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[c.jsx(Qe,{label:m("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(Fa,{size:14,className:"animate-spin"}):c.jsx(Cr,{size:14}),c.jsx("span",{className:"hidden sm:inline",children:m("actionCenter.copyRecap")})]})}),c.jsx(Qe,{label:m("common.close"),children:c.jsx("button",{type:"button",onClick:o,"aria-label":m("common.close"),className:"icon-btn pointer-coarse:min-h-11 pointer-coarse:min-w-11",children:c.jsx(Ka,{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(Fs,{size:15,"aria-hidden":!0}),c.jsx("span",{children:m("actionCenter.loadFailed")})]}):null,f?c.jsxs("div",{className:"space-y-4",children:[c.jsxs("section",{className:"action-center-hero","data-state":p.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(iy,{size:13,"aria-hidden":!0}),m("actionCenter.liveSnapshot")]}),c.jsx("span",{className:"text-[11px] text-ter",children:m("actionCenter.updated",{ago:_w(f.generatedAt,m)})})]}),c.jsx("p",{className:"mt-2 text-sm font-medium text-pri",children:v?Jl(v,m):m("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:p.length>0?m("actionCenter.needsAttention",{count:p.length}):m("actionCenter.allClear")})]}),c.jsxs("section",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-4","aria-label":m("actionCenter.metrics"),children:[c.jsx(_l,{icon:c.jsx(hc,{size:15}),label:m("actionCenter.totalWorkers"),value:f.summary.totalWorkers}),c.jsx(_l,{icon:c.jsx(iy,{size:15}),label:m("actionCenter.workingWorkers"),tone:"green",value:f.summary.workingWorkers}),c.jsx(_l,{icon:c.jsx(OS,{size:15}),label:m("actionCenter.openDispatches"),tone:f.summary.openDispatches>0?"orange":"neutral",value:f.summary.openDispatches}),c.jsx(_l,{icon:c.jsx(Pb,{size:15}),label:m("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:m("actionCenter.attention")}),c.jsx("p",{children:m("actionCenter.attentionSubtitle")})]})}),p.length>0?c.jsx("ul",{className:"space-y-2",children:p.map(w=>c.jsx("li",{children:c.jsxs("div",{className:"action-center-attention-row","data-severity":w.severity,"data-testid":`action-center-attention-${ec(w)}`,children:[c.jsx(Fs,{size:14,"aria-hidden":!0}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:$f(w,m)})]})},ec(w)))}):c.jsx("div",{className:"action-center-empty",children:m("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:m("actionCenter.recent")}),c.jsx("p",{children:m("actionCenter.recentSubtitle")})]})}),S.length>0?c.jsx("ul",{className:"space-y-1.5",children:S.map(w=>{const E=Wm(w);return c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>T(w.toAgentId),className:"action-center-list-row","data-tone":SA(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:Jl(w,m)}),E?c.jsx("span",{className:"block truncate text-[11px] text-ter",children:E}):null]})]})},w.id)})}):c.jsx("div",{className:"action-center-empty",children:m("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:m("actionCenter.workers")}),c.jsx("p",{children:m("actionCenter.workersSubtitle")})]})}),y.length>0?c.jsx("ul",{className:"space-y-1.5",children:y.map(w=>{const E=Rw(w);return c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>T(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(OE,{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:Ow(w,m)})]}),E?c.jsx("span",{className:"block truncate text-[11px] text-ter",children:E}):null]})]})},w.id)})}):c.jsx("div",{className:"action-center-empty",children:m("actionCenter.noWorkerEvidence")})]})]})]}):c.jsxs("div",{className:"flex h-[320px] items-center justify-center text-ter",children:[c.jsx(Fa,{size:18,className:"animate-spin"}),c.jsx("span",{className:"ml-2 text-sm",children:m("actionCenter.loading")})]})]})]})})]})})},TA=({onOpenWorker:t,workspaceId:a})=>{const{t:o}=we(),{error:i,summary:l}=Dw(a),{copyingRecap:u,handleCopyRecap:f}=Mw(a),[m,g]=b.useState(!1);return c.jsxs(c.Fragment,{children:[c.jsx(Qe,{label:o(m?"actionCenter.collapse":"actionCenter.expand"),children:c.jsxs("button",{type:"button",onClick:()=>g(p=>!p),"aria-expanded":m,"aria-haspopup":"dialog","aria-label":o(m?"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(dc,{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(CA,{copyingRecap:u,error:i,onClose:()=>g(!1),onCopyRecap:f,onOpenWorker:t,open:m,summary:l})]})},NA=({onOpenWorker:t,workspaceId:a})=>{const{t:o}=we(),{error:i,summary:l}=Dw(a),{copyingRecap:u,handleCopyRecap:f}=Mw(a),[m,g]=b.useState(!1),{latest:p,latestDetail:y}=Im(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":m,"aria-label":o(m?"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:[m?c.jsx(No,{size:13,"aria-hidden":!0}):c.jsx(fc,{size:13,"aria-hidden":!0}),c.jsx(dc,{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")}):p?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"shrink-0 text-ter",children:Jl(p,o)}),y?c.jsxs("span",{className:"min-w-0 truncate text-ter",title:y,children:["· ",y]}):null]}):c.jsx("span",{className:"text-ter",children:o(l?"actionCenter.noActivity":"actionCenter.loading")})}),m&&l?c.jsx(EA,{copyingRecap:u,onCopyRecap:f,onOpenWorker:t,summary:l}):null]})};let tc=!1;const Gf=new Set,jA=()=>tc,Lw=t=>{if(tc!==t){tc=t;for(const a of Gf)a()}},AA=()=>{Lw(!tc)},_A=t=>(Gf.add(t),()=>Gf.delete(t)),zw=()=>b.useSyncExternalStore(_A,jA,()=>!1),Hw="hive.notification.settings",po={desktop:!1,detail:"brief",sound:"soft"},RA={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"},OA=t=>t==="off"||t==="ping"||t==="chime"||t==="soft"||t==="cascade"||t==="beacon"||t==="resolve",DA=()=>{if(typeof window>"u")return po;try{const t=window.localStorage.getItem(Hw);if(!t)return po;const a=JSON.parse(t);return{desktop:typeof a.desktop=="boolean"?a.desktop:po.desktop,detail:a.detail==="detailed"?"detailed":po.detail,sound:OA(a.sound)?a.sound:po.sound}}catch{return po}},MA=t=>{try{window.localStorage.setItem(Hw,JSON.stringify(t))}catch{}},Ly=t=>{if(!(t==="off"||typeof window>"u"))try{const a=new window.Audio(RA[t]);a.preload="auto",a.volume=.72,a.play()?.catch(()=>{})}catch{}},Bw=b.createContext(null),LA=({children:t})=>{const a=en(),{t:o}=we(),[i,l]=b.useState(()=>DA());b.useEffect(()=>{MA(i)},[i]);const u=b.useCallback(y=>{l(v=>({...v,...y}))},[]),f=b.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]),m=b.useCallback(({brief:y,detail:v,kind:k,title:S})=>{const T=i.detail==="detailed"&&v?v:y;if(a.show({kind:k,message:T}),Ly(i.sound),i.desktop&&typeof window<"u"&&"Notification"in window&&window.Notification.permission==="granted")try{new window.Notification(S,{body:T})}catch{}},[i,a]),g=b.useCallback(y=>{Ly(y)},[]),p=b.useMemo(()=>({notify:m,previewSound:g,requestDesktopNotifications:f,settings:i,updateSettings:u}),[m,g,f,i,u]);return c.jsx(Bw.Provider,{value:p,children:t})},Nc=()=>{const t=b.useContext(Bw);if(!t)throw new Error("useNotifications must be used within NotificationProvider");return t},zA={coder:"role.coder",custom:"role.custom",reviewer:"role.reviewer",sentinel:"role.sentinel",tester:"role.tester"},HA=t=>new Map(t.map(a=>[a.id,{id:a.id,name:a.name,pendingTaskCount:a.pendingTaskCount,role:a.role,status:a.status}])),BA=({terminalRuns:t,workers:a,workspace:o})=>{const{notify:i}=Nc(),{t:l}=we(),u=b.useRef(null);return b.useEffect(()=>{if(!o){u.current=null;return}const f=HA(a),m=u.current;if(u.current={workers:f,workspaceId:o.id},!(!m||m.workspaceId!==o.id))for(const g of f.values()){const p=m.workers.get(g.id);if(!p)continue;if(p.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(p.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(zA[g.role])}),kind:"success",title:l("notifications.workerStarted.title")});continue}(g.pendingTaskCount<p.pendingTaskCount||p.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},UA=({tabs:t,activeId:a,onSelect:o,onClose:i,onClosePanel:l,onNewShell:u,newShellPending:f})=>{const{t:m}=we();return c.jsxs("div",{role:"tablist","aria-label":m("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 p=g.id===a,y=m("terminalPanel.closeTab",{name:g.label}),v=k=>{k.stopPropagation(),i(g.id)};return c.jsxs("div",{role:"tab","aria-selected":p,"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:p?"var(--bg-1)":"transparent",borderRightColor:"var(--border)",color:p?"var(--text-primary)":"var(--text-secondary)"},children:[p?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(mc,{size:12,"aria-hidden":!0}),c.jsx("span",{className:"truncate",children:g.label})]}),c.jsx(Qe,{label:y,children:c.jsx("button",{type:"button","aria-label":y,"data-testid":`terminal-tab-close-${g.id}`,onClick:v,className:`mr-1 rounded p-0.5 pointer-coarse:p-2 transition ${p?"opacity-100":"opacity-0 group-hover:opacity-100 pointer-coarse:opacity-100"}`,style:{color:"var(--text-secondary)"},children:c.jsx(Ka,{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(Qe,{label:m("terminalPanel.closePanel"),children:c.jsx("button",{type:"button","aria-label":m("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(Ka,{size:12,"aria-hidden":!0})})}),c.jsx(Qe,{label:m("terminalPanel.newShell"),children:c.jsx("button",{type:"button","aria-label":m("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(Fa,{size:12,className:"animate-spin","aria-hidden":!0}):c.jsx(Fl,{size:12,"aria-hidden":!0})})})]})]})},Uw="hive.terminal-panel.height",Ww="hive.terminal-panel.collapsed",Xf=160,WA=.35,IA=160,Us=t=>{const a=typeof window<"u"?window.innerHeight:800,o=Math.max(Xf,a-IA);return Math.min(Math.max(t,Xf),o)},yf=()=>{const t=typeof window<"u"?window.innerHeight:800;return Us(Math.floor(t*WA))},qA=()=>{try{const t=window.localStorage.getItem(Uw);if(!t)return yf();const a=Number.parseInt(t,10);return Number.isFinite(a)?Us(a):yf()}catch{return yf()}},PA=()=>{try{return window.localStorage.getItem(Ww)==="1"}catch{return!1}},FA=()=>{const[t,a]=b.useState(()=>qA()),[o,i]=b.useState(()=>PA()),[l,u]=b.useState(!1);b.useEffect(()=>{try{window.localStorage.setItem(Uw,String(Math.round(t)))}catch{}},[t]),b.useEffect(()=>{try{window.localStorage.setItem(Ww,o?"1":"0")}catch{}},[o]),b.useEffect(()=>{const p=()=>a(y=>Us(y));return window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]);const f=b.useCallback(p=>a(Us(p)),[]),m=b.useCallback(p=>i(p),[]),g=b.useCallback(p=>{p.preventDefault();const y=p.clientY;let v=t;a(E=>(v=E,E)),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 T=E=>{const C=E.clientY-y;a(Us(v-C))},w=()=>{u(!1),document.body.style.cursor=k,document.body.style.userSelect=S,document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",w),document.removeEventListener("pointercancel",w)};document.addEventListener("pointermove",T),document.addEventListener("pointerup",w),document.addEventListener("pointercancel",w)},[t]);return{height:t,collapsed:o,dragging:l,setHeight:f,setCollapsed:m,beginDrag:g}},KA=(t,a)=>a?t.find(o=>o.id===a)??null:null,YA=({tabs:t,activeId:a,onSelect:o,onClose:i,onClosePanel:l,onNewShell:u,newShellPending:f,onStartWorker:m,startingWorkerId:g})=>{const{t:p}=we(),y=FA(),v=wt();if(t.length===0)return null;const k=KA(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%":y.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":p("terminalPanel.resizeAria"),"aria-valuemin":Xf,"aria-valuenow":Math.round(y.height),className:"absolute top-0 right-0 left-0 z-10 h-2 -translate-y-1 cursor-ns-resize",tabIndex:-1,"data-resizing":y.dragging||void 0,"data-testid":"terminal-panel-resize-handle",onPointerDown:y.beginDrag}),c.jsx(UA,{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(VA,{tab:S,isActive:S.id===(k?.id??null),onStartWorker:m,startingWorkerId:g},S.id))})]})},VA=({tab:t,isActive:a,onStartWorker:o,startingWorkerId:i})=>{const{t:l}=we(),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(mc,{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(Fa,{size:12,className:"animate-spin","aria-hidden":!0}):c.jsx(jo,{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}`})},bf=t=>`hive.terminal-panel.tabs.${t}`,wf=t=>`hive.terminal-panel.active.${t}`,$A=t=>`worker:${t}`,GA=t=>`shell:${t}`,zy=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[]}},Hy=t=>{try{return window.localStorage.getItem(t)??""}catch{return""}},By=(t,a)=>{try{window.localStorage.setItem(t,a)}catch{}},XA=({workspaceId:t,workers:a,terminalRuns:o})=>{const[i,l]=b.useState(()=>zy(bf(t))),[u,f]=b.useState(()=>{const j=Hy(wf(t));return j.length>0?j:null}),m=b.useRef(i);m.current=i;const g=b.useRef(t);b.useEffect(()=>{if(g.current===t)return;g.current=t,l(zy(bf(t)));const j=Hy(wf(t));f(j.length>0?j:null)},[t]);const p=b.useRef(!1);b.useEffect(()=>{p.current=a.length>0||o.length>0},[t]),b.useEffect(()=>{(a.length>0||o.length>0)&&(p.current=!0)},[a,o]),b.useEffect(()=>{p.current&&By(bf(t),JSON.stringify(i))},[i,t]),b.useEffect(()=>{p.current&&By(wf(t),u??"")},[u,t]);const y=b.useMemo(()=>new Map(a.map(j=>[j.id,j])),[a]),{runByAgentId:v,shellRunById:k}=b.useMemo(()=>{const j=new Map,_=new Map;for(const N of o)j.set(N.agent_id,N),bc(N,t)&&_.set(N.run_id,N);return{runByAgentId:j,shellRunById:_}},[o,t]),S=b.useMemo(()=>{const j=[];for(const _ of i)if(_.startsWith("worker:")){const N=_.slice(7),O=y.get(N);if(!O)continue;const M=v.get(O.id);j.push({id:_,kind:"worker",workerId:N,runId:M?.run_id??null,label:O.name})}else if(_.startsWith("shell:")){const N=_.slice(6),O=k.get(N);if(!O)continue;j.push({id:_,kind:"shell",runId:N,label:O.agent_name})}return j},[i,y,v,k]);b.useEffect(()=>{p.current&&l(j=>{const _=j.filter(N=>N.startsWith("worker:")?y.has(N.slice(7)):N.startsWith("shell:")?k.has(N.slice(6)):!1);return _.length===j.length?j:_})},[y,k]),b.useEffect(()=>{p.current&&(u&&S.some(j=>j.id===u)||f(S[0]?.id??null))},[u,S]);const T=b.useCallback(j=>{p.current=!0;const _=$A(j);l(N=>N.includes(_)?N:[...N,_]),f(_)},[]),w=b.useCallback(j=>{p.current=!0;const _=GA(j);l(N=>N.includes(_)?N:[...N,_]),f(_)},[]),E=b.useCallback(j=>{const _=m.current,N=_.filter(O=>O!==j);N.length!==_.length&&(l(N),f(O=>{if(O!==j)return O;const M=_.indexOf(j);return N[M]??N[M-1]??N[0]??null}))},[]),C=b.useCallback(j=>f(j),[]);return{tabs:S,activeId:u,openWorkerTab:T,openShellTab:w,closeTab:E,setActive:C}},Uy=500,ZA=2500,QA=5e3,JA=t=>t.status==="starting"||t.status==="running",e_=(t,a)=>t>0?Math.min(Uy*2**t,QA):a.some(JA)?Uy:ZA,Iw=t=>`${t}:orchestrator`,t_=(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}),n_=t=>{const[a,o]=b.useState([]);return b.useEffect(()=>{if(!t){o([]);return}let i=!1,l=0,u=!1,f=[],m;const g=()=>{i||(m=window.setTimeout(p,e_(l,f)))},p=()=>{u||(u=!0,eN(t).then(y=>{i||(l=0,f=y,o(v=>t_(v,y)?v:y))}).catch(y=>{i||(l=Math.min(l+1,4),o(v=>v.length===0?v:[])),console.error("[hive] swallowed:terminalRuns.list",y)}).finally(()=>{u=!1,g()}))};return p(),()=>{i=!0,m!==void 0&&window.clearTimeout(m)}},[t]),a},a_=(t,a)=>t.find(o=>o.agent_id===Iw(a)),r_=(t,a)=>t.find(o=>o.agent_id===a),o_=({onCloseFailed:t,onShellRunClosed:a,onShellRunStarted:o,panelTabs:i,shellRuns:l,workspaceId:u})=>{const[f,m]=b.useState(null),[g,p]=b.useState(null),[y,v]=b.useState(!1),k=b.useRef(new Map),S=b.useRef(0),T=b.useRef(new Map),w=b.useRef(new Map),E=b.useRef(new Set),C=b.useRef(u),_=(l.find(F=>F.run_id===g)??l[0]??null)?.run_id??null,N=b.useCallback((F,J)=>{const X=T.current.get(F)??new Set;X.add(J),T.current.set(F,X)},[]),O=b.useCallback((F,J,X)=>{const V=w.current.get(F)??new Map;V.set(J,X),w.current.set(F,V),X.finally(()=>{const D=w.current.get(F);D&&(D.delete(J),D.size===0&&w.current.delete(F))}).catch(()=>{})},[]),M=b.useCallback((F,J)=>{const X=T.current.get(F);X&&(X.delete(J),X.size===0&&T.current.delete(F))},[]);b.useLayoutEffect(()=>{C.current=u},[u]),b.useEffect(()=>()=>{T.current.clear(),w.current.clear(),E.current.clear()},[]),b.useEffect(()=>{m(null),p(null),v(!1)},[u]),b.useEffect(()=>{if(!u)return;const F=T.current.get(u);if(!F)return;const J=new Set(l.map(V=>V.run_id)),X=w.current.get(u);for(const V of Array.from(F))X?.has(V)||J.has(V)||M(u,V)},[l,M,u]);const L=()=>{if(!u||k.current.has(u))return;const F=u,J=S.current+1;S.current=J,k.current.set(F,J);const X=()=>C.current===F,V=()=>k.current.get(F)===J;m(null),v(!0),GT(F).then(D=>{o?.(F,D),X()&&(p(D.run_id),i.openShellTab(D.run_id))}).catch(D=>{X()&&m(D instanceof Error?D.message:String(D))}).finally(()=>{V()&&k.current.delete(F),X()&&v(!1)})},U=()=>{if(!u||k.current.has(u)||E.current.has(u))return;const F=u,J=Array.from(w.current.get(F)?.values()??[]);if(J.length===0){L();return}E.current.add(F),m(null),v(!0),Promise.allSettled(J).then(X=>{X.some(V=>V.status==="rejected")||C.current===F&&(k.current.has(F)||L())}).finally(()=>{E.current.delete(F),C.current===F&&!k.current.has(F)&&v(!1)})};return{closeShellTab:F=>{if(!u)return;const J=l.find(V=>V.run_id!==F)??null;_===F&&p(J?.run_id??null),a?.(u,F),N(u,F);const X=XT(u,F).catch(V=>{throw M(u,F),t(V instanceof Error?V.message:String(V)),V});O(u,F,X),X.catch(()=>{})},openShell:()=>{if(!u||k.current.has(u)||y)return;const F=i.tabs.find(V=>V.kind==="shell");if(F){i.setActive(F.id);return}const J=T.current.get(u)??new Set,X=l.find(V=>!J.has(V.run_id));if(X){p(X.run_id),i.openShellTab(X.run_id);return}if(J.size>0){U();return}L()},shellError:f,shellStarting:y,startNewShell:()=>{if(!u||k.current.has(u)||y)return;if((T.current.get(u)??new Set).size>0){U();return}L()}}},qw="hive.split.orch-pct",Hs=.3,Bs=.78,Bl=.6,Wy=.02,Ul=(t,a,o)=>Math.min(o,Math.max(a,t)),s_=()=>{try{const t=localStorage.getItem(qw);if(!t)return Bl;const a=Number.parseFloat(t);return Number.isFinite(a)?Ul(a,Hs,Bs):Bl}catch{return Bl}},i_=()=>{const t=b.useRef(null),[a,o]=b.useState(()=>s_()),[i,l]=b.useState(!1);b.useEffect(()=>{try{localStorage.setItem(qw,a.toFixed(4))}catch{}},[a]);const u=b.useCallback(m=>{m.preventDefault();const g=t.current;if(!g)return;l(!0);const p=document.body.style.userSelect,y=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const v=S=>{const T=g.getBoundingClientRect();if(T.width<=0)return;const w=(S.clientX-T.left)/T.width;o(Ul(w,Hs,Bs))},k=()=>{l(!1),document.body.style.userSelect=p,document.body.style.cursor=y,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=b.useCallback(m=>{m.key==="ArrowLeft"?(m.preventDefault(),o(g=>Ul(g-Wy,Hs,Bs))):m.key==="ArrowRight"?(m.preventDefault(),o(g=>Ul(g+Wy,Hs,Bs))):m.key==="Home"?(m.preventDefault(),o(Hs)):m.key==="End"?(m.preventDefault(),o(Bs)):m.key==="Enter"&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),o(Bl))},[]);return{containerRef:t,orchPct:a,dragging:i,beginDrag:u,onKeyDown:f}},ai=({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]}),Ua=t=>a=>{console.error(`[hive] swallowed:${t}`,a)},l_={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"}},c_=t=>l_[t]??null,u_=({presetId:t,presetName:a})=>{const{t:o}=we(),i=c_(t),[l,u]=b.useState(!1),[f,m]=b.useState(!1),g=b.useRef(null);b.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]);const p=()=>{i&&Y0(i.command).then(()=>{u(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{u(!1),g.current=null},1500)}).catch(Ua("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:p,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(Ga,{size:13,"aria-hidden":!0}):c.jsx(Cr,{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(wm,{size:11,"aria-hidden":!0}),o("workspace.preset.installDocs")]})]}):null,c.jsxs("button",{type:"button",onClick:()=>m(y=>!y),"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(No,{size:12,"aria-hidden":!0}):c.jsx(fc,{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]})},d_={"cursor-agent":"cursor"},f_=/^(\S+) CLI not found in PATH/u,m_=()=>{const{t}=we();return c.jsx("div",{"data-testid":"orchestrator-starting-body",className:"flex flex-1",children:c.jsx(ai,{icon:c.jsx(Fa,{size:24,className:"animate-spin"}),title:t("orchestrator.startingTitle"),description:t("orchestrator.startingDesc")})})},p_=({onStart:t})=>{const{t:a}=we();return c.jsx("div",{"data-testid":"orchestrator-stopped-body",className:"flex flex-1",children:c.jsx(ai,{icon:c.jsx(bm,{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(jo,{size:12,"aria-hidden":!0})," ",a("orchestrator.start")]})})})},h_=({error:t,onRemoveWorkspace:a,onRestart:o})=>{const{t:i}=we(),[l,u]=b.useState(!1),f=()=>{navigator.clipboard?.writeText(t).then(()=>{u(!0),window.setTimeout(()=>u(!1),1500)}).catch(()=>{})},m=f_.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(bm,{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(Qe,{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(Cr,{size:12,"aria-hidden":!0})})})]}),m?c.jsx("div",{className:"w-full",children:c.jsx(u_,{presetId:d_[m]??m,presetName:m})}):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(km,{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")})]})},g_=({state:t,onRemoveWorkspace:a,onRestart:o,onStart:i})=>{const{t:l}=we(),u=wt();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(h_,{error:t.error,onRemoveWorkspace:a,onRestart:o}):t.kind==="stopped"?c.jsx(p_,{onStart:i}):c.jsx(m_,{})})},v_=({workspaceId:t,terminalRuns:a,autostartError:o,suppressAutostartRunId:i,onClearAutostartError:l,onAfterStart:u})=>{const f=a_(a,t),m=Iw(t),[g,p]=b.useState(null),[y,v]=b.useState(null),[k,S]=b.useState(null),T=y?.workspaceId===t?y.runId:null,w=!!(k&&!f&&!T);b.useEffect(()=>{S(i??null)},[i]),b.useEffect(()=>{f&&(p(null),v(null),S(null))},[f]),b.useEffect(()=>{if(!k||f)return;const N=window.setTimeout(()=>S(null),1500);return()=>window.clearTimeout(N)},[k,f]),b.useEffect(()=>{if(!T||f)return;const N=window.setTimeout(()=>v(null),2e3);return()=>window.clearTimeout(N)},[T,f]);let E;f?E={hasUserInputSinceStart:f.has_user_input_since_start===!0,kind:"running",runId:f.run_id,startupBlockedReason:f.startup_blocked_reason??null}:T?E={hasUserInputSinceStart:!1,kind:"running",runId:T,startupBlockedReason:null}:g===t||w?E={kind:"starting"}:o?E={kind:"failed",error:o}:E={kind:"stopped"};const C=b.useCallback(()=>{!t||g===t||f||(l(),p(t),Vl(t,m).then(N=>{v({workspaceId:t,runId:N.runId}),u?.({ok:!0,error:null,run_id:N.runId})}).catch(N=>{const O=N instanceof Error?N.message:"Failed to start Queen";v(null),u?.({ok:!1,error:O,run_id:null})}).finally(()=>p(N=>N===t?null:N)))},[m,u,l,f,g,t]),j=b.useCallback(()=>{f&&$l(f.run_id).catch(N=>{console.error("[hive] swallowed:orchestrator.stop",N)})},[f]),_=b.useCallback(()=>{if(l(),f){$l(f.run_id).catch(N=>{console.error("[hive] swallowed:orchestrator.restart.stop",N)}).then(()=>Vl(t,m)).then(N=>{v({workspaceId:t,runId:N.runId}),u?.({ok:!0,error:null,run_id:N.runId})}).catch(N=>{const O=N instanceof Error?N.message:"Failed to restart Queen";u?.({ok:!1,error:O,run_id:null})});return}C()},[m,u,l,f,C,t]);return{state:E,start:C,stop:j,restart:_}},Pw=["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"],Fw=["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"],Kw=["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"],y_=["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"],Yw=["八大山人","毕昇","蔡伦","干将","顾恺之","黄道婆","李冰","柳公权","鲁班","莫邪","墨子","沈括","宋应星","唐寅","王羲之","文徵明","吴道子","颜真卿","张衡","张择端","郑板桥","祖冲之"],Vw=["班固","包拯","狄仁杰","董仲舒","范仲淹","顾炎武","管仲","海瑞","韩非","韩愈","嵇康","贾谊","孔子","老子","林则徐","柳宗元","孟子","欧阳修","商鞅","司马光","司马迁","谭嗣同","王安石","王守仁","魏徵","荀子","张居正","周敦颐","朱熹","庄子"],$w=["班超","扁鹊","法显","葛洪","华佗","鉴真","郦道元","李时珍","神农","苏武","孙思邈","陶弘景","徐光启","徐霞客","玄奘","张骞","张仲景","郑和"],b_=["白居易","蔡文姬","曹操","曹雪芹","曹植","程咬金","大禹","杜甫","杜牧","范蠡","关羽","汉武帝","韩信","忽必烈","花木兰","黄帝","霍去病","姜子牙","康熙","李白","李广","李靖","李清照","李煜","刘邦","刘备","刘伯温","柳永","陆游","罗贯中","吕布","吕不韦","孟浩然","蒙恬","努尔哈赤","庞统","蒲松龄","戚继光","乾隆","秦始皇","屈原","上官婉儿","施耐庵","司马懿","苏轼","孙膑","孙权","孙武","孙中山","唐太宗","唐玄宗","陶渊明","王维","卫青","文天祥","吴承恩","吴起","萧何","谢安","辛弃疾","杨贵妃","雍正","虞姬","岳飞","张飞","张良","张仪","赵子龙","周瑜","朱棣","诸葛亮","朱元璋","左宗棠"],w_=[...Pw,...Fw,...Kw,...y_],x_=[...Yw,...Vw,...$w,...b_],k_=["argus","cassandra","copernicus","halley","herodotus","hypatia","kepler","ptolemy","thucydides","tycho-brahe"],S_=["班固","郭守敬","沈括","司马光","司马迁","一行","张衡","祖冲之"],E_={en:{coder:Pw,reviewer:Fw,tester:Kw,sentinel:k_,custom:w_},zh:{coder:Yw,reviewer:Vw,tester:$w,sentinel:S_,custom:x_}},C_=()=>{const t=new Uint32Array(1);return globalThis.crypto.getRandomValues(t),t[0]??0},xf=({language:t="en",role:a="coder",usedNames:o,nextUint32:i=C_}={})=>{const l=E_[t][a],u=o&&o.size>0?l.filter(m=>!o.has(m)):l,f=u.length>0?u:l;return f[i()%f.length]},Ws={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
|
+
`)}},kf=(t,a,o)=>t==="custom"?a.find(i=>i.roleType==="custom"&&i.isBuiltin)?.description??Ws[o].custom:Ws[o][t],T_=({createWorker:t,open:a,workers:o})=>{const{language:i}=we(),[l,u]=b.useState(""),[f,m]=b.useState("coder"),[g,p]=b.useState([]),[y,v]=b.useState(null),[k,S]=b.useState(!1),[T,w]=b.useState(null),[E,C]=b.useState(Ws[i].coder),[j,_]=b.useState([]),[N,O]=b.useState("claude"),[M,L]=b.useState(""),[U,q]=b.useState(null),[ae,ee]=b.useState(!1),F=b.useRef(!1),J=b.useRef(!1),X=b.useRef(!1),V=kf(f,g,i),D=b.useMemo(()=>g.filter(ce=>!ce.isBuiltin),[g]);b.useEffect(()=>{if(!a)return;let ce=!1;return VT().then(me=>{ce||(_(me),O(Te=>me.some(Ne=>Ne.id===Te&&Ne.available)?Te:me.find(Ne=>Ne.id==="claude"&&Ne.available)?.id??me.find(Ne=>Ne.available)?.id??me[0]?.id??""))}).catch(me=>{ce||q(me instanceof Error?me.message:String(me))}),()=>{ce=!0}},[a]),b.useEffect(()=>{if(!a)return;let ce=!1;return ZT().then(me=>{ce||p(me)}).catch(me=>{ce||q(me instanceof Error?me.message:String(me))}),()=>{ce=!0}},[a]),b.useEffect(()=>{y===null&&(J.current||C(kf(f,g,i)))},[i,g,f,y]);const P=ce=>{J.current=!0,C(ce)},I=ce=>{F.current=!1,u(ce)},$=b.useMemo(()=>new Set(o.map(ce=>ce.name)),[o]),Z=b.useRef($);Z.current=$;const R=()=>{F.current=!0,u(xf({language:i,role:f,usedNames:$}))};b.useEffect(()=>{const ce=a&&!X.current;if(X.current=a,!!a){if(ce){F.current=!0,u(xf({language:i,role:f,usedNames:Z.current}));return}F.current&&u(xf({language:i,role:f,usedNames:Z.current}))}},[a,i,f]);const B=ce=>{m(ce),v(null),J.current=!1,C(kf(ce,g,i))};return{commandPresets:j,commandPresetId:N,createWorkerError:U,creating:ae,customTemplates:D,roleDescription:E,roleDescriptionDefault:V,selectedTemplateId:y,startupCommand:M,templateBusy:k,templateError:T,workerName:l,workerRole:f,setCommandPresetId:ce=>{O(ce)},setRoleDescription:P,setStartupCommand:L,setWorkerName:I,setWorkerRole:B,selectTemplate:ce=>{if(ce===null){m("custom"),v(null),J.current=!1,C(Ws[i].custom);return}const me=g.find(Te=>Te.id===ce);!me||me.isBuiltin||(m("custom"),v(ce),J.current=!1,C(me.description))},saveAsTemplate:async ce=>{const me=ce.trim(),Te=E.trim();if(!(!me||!Te)){S(!0),w(null);try{const Ne=await QT({name:me,roleType:"custom",description:Te});p(Se=>[...Se,Ne]),v(Ne.id),m("custom"),J.current=!1,C(Ne.description)}catch(Ne){throw w(Ne instanceof Error?Ne.message:String(Ne)),Ne}finally{S(!1)}}},deleteTemplate:async ce=>{const me=g.find(Te=>Te.id===ce);if(!(!me||me.isBuiltin)){S(!0),w(null);try{await JT(ce),p(Te=>Te.filter(Ne=>Ne.id!==ce)),y===ce&&(v(null),J.current=!1,C(Ws[i].custom))}catch(Te){throw w(Te instanceof Error?Te.message:String(Te)),Te}finally{S(!1)}}},randomizeWorkerName:R,resetRoleDescription:()=>{J.current=!1,C(V)},resetError:()=>q(null),applyMarketplaceImport:({name:ce,description:me})=>{F.current=!1,u(ce),v(null),m("custom"),J.current=!0,C(me)},submit:(ce,me)=>{ce.preventDefault(),ee(!0),q(null),t({commandPresetId:N,name:l,role:f,roleDescription:E,startupCommand:M}).then(({error:Te})=>{u(""),F.current=!1,B("coder"),v(null),O("claude"),L(""),me(),Te&&q(Te)}).catch(Te=>{q(Te instanceof Error?Te.message:String(Te))}).finally(()=>ee(!1))}}},N_=[{icon:c.jsx(Fb,{size:16}),titleKey:"welcome.step1Title",descriptionKey:"welcome.step1Desc"},{icon:c.jsx(hc,{size:16}),titleKey:"welcome.step2Title",descriptionKey:"welcome.step2Desc"},{icon:c.jsx(gE,{size:16}),titleKey:"welcome.step3Title",descriptionKey:"welcome.step3Desc"}],j_=({onAddWorkspace:t,onTryDemo:a,heroImageSrc:o,disabledReason:i})=>{const{t:l}=we(),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:N_.map((f,m)=>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:m+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(Fs,{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(iS,{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]})},Sf=t=>t==="danger"?"var(--status-red)":"var(--accent)",ri=({open:t,onOpenChange:a,title:o,description:i,confirmLabel:l,confirmKind:u="default",cancelLabel:f,onConfirm:m})=>{const{t:g}=we(),p=f??g("common.cancel");return c.jsx(_o,{open:t,onOpenChange:a,children:c.jsxs(Ro,{children:[c.jsx(Oo,{"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(Do,{"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, ${Sf(u)} 14%, transparent)`,color:Sf(u),border:`1px solid color-mix(in oklab, ${Sf(u)} 30%, transparent)`},children:u==="danger"?c.jsx(Fs,{size:18}):c.jsx(TS,{size:18})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx(Mo,{"data-testid":"confirm-title",className:"text-lg font-semibold text-pri",children:o}),c.jsx(ei,{"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:p}),c.jsx("button",{type:"button","data-testid":"confirm-action",onClick:()=>{m(),a(!1)},autoFocus:u!=="danger",className:u==="danger"?"icon-btn icon-btn--danger-solid":"icon-btn icon-btn--primary",children:l})]})]})})]})})},A_=["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
|
+
`),__=["你是 Researcher,负责为指定主题收集事实、数据和来源。","工作方式:","- 先拆出要回答的关键问题,再逐项调查。","- 优先一手来源和项目内真实文件;每个结论都附上来源或文件路径。","- 区分事实、推断和未知,不把猜测写成结论。","交付说明:按主题列出发现、来源清单和未解决问题。"].join(`
|
|
67
|
+
`),R_=["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
|
+
`),O_=["你是 Fact-checker,负责验证研究结论和证据强度,默认不扩范围。","工作方式:","- 逐条核对结论与其来源,标注支持、存疑或不支持。","- 对关键结论用第二来源、命令或直接读文件做交叉验证。","- 发现错误时给出纠正后的表述和依据。","交付说明:按可信度分组,先列被推翻或存疑的结论。"].join(`
|
|
69
|
+
`),D_=["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
|
+
`),M_=["你是 Drafter,负责把目标和素材写成清晰的第一版文档。","工作方式:","- 先确认读者、目的和范围,再列提纲,后成文。","- 以项目内真实代码和文件为准,不编造行为或接口。","- 标注待确认和缺素材的位置。","交付说明:包含文档路径、结构概览和确认清单。"].join(`
|
|
71
|
+
`),L_=["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
|
+
`),z_=["你是 Document Reviewer,负责检查草稿的准确性和可读性;默认不要整篇重写。","工作方式:","- 先对照项目真实代码和文件核对技术细节。","- 检查结构、术语一致性,以及读者能否按文档完成操作。","- 问题按严重度列出,给出具体修改建议或改写示例。","交付说明:先列事实错误,再列结构和表达问题。"].join(`
|
|
73
|
+
`),H_=[{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:A_,zh:__}},{nameStem:"factchecker",role:"custom",descriptionOverride:{en:R_,zh:O_}}],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:D_,zh:M_}},{nameStem:"doc-reviewer",role:"custom",descriptionOverride:{en:L_,zh:z_}}],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 审查;写明读者、范围、必备章节,以及它要描述的代码或文件。"}}],Iy={build_review_test:{icon:c.jsx(YS,{size:16,"aria-hidden":!0}),titleKey:"scenario.build_review_test.title",descKey:"scenario.build_review_test.desc"},research_factcheck:{icon:c.jsx(uS,{size:16,"aria-hidden":!0}),titleKey:"scenario.research_factcheck.title",descKey:"scenario.research_factcheck.desc"},docs_pipeline:{icon:c.jsx(Pb,{size:16,"aria-hidden":!0}),titleKey:"scenario.docs_pipeline.title",descKey:"scenario.docs_pipeline.desc"}},B_=({workspaceId:t})=>{const{language:a,t:o}=we(),i=en(),[l,u]=b.useState(null),[f,m]=b.useState(""),[g,p]=b.useState(!1),y=S=>{m(S.goalTemplate[a]),u(S)},v=()=>{g||u(null)},k=()=>{!l||g||!f.trim()||(p(!0),nN(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(()=>p(!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(Gb,{size:12,"aria-hidden":!0}),o("scenario.sectionTitle")]}),c.jsx("div",{className:"flex flex-col gap-2",children:H_.map(S=>{const T=Iy[S.id];return c.jsxs("button",{type:"button",onClick:()=>y(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:[T.icon,c.jsx("span",{className:"text-sm font-medium",children:o(T.titleKey)})]}),c.jsx("div",{className:"mt-1 text-xs text-ter",children:o(T.descKey)})]},S.id)})}),c.jsx(_o,{open:l!==null,onOpenChange:S=>{S||v()},children:c.jsxs(Ro,{children:[c.jsx(Oo,{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(Do,{"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(Mo,{className:"text-lg font-semibold text-pri",children:l?o(Iy[l.id].titleKey):""}),c.jsx(ei,{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=>m(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")})]})]})})]})})]})},Gw=({size:t,children:a,color:o,fontRatio:i=.4,ringColor:l=null,ringSurface:u="var(--bg-1)",mono:f=!1,decoration:m,testId:g,data:p,className:y="",style:v={}})=>{const k={};if(p)for(const[S,T]of Object.entries(p))T!==void 0&&(k[`data-${S}`]=T);return c.jsxs("span",{"data-testid":g,...k,className:`relative inline-flex shrink-0 items-center justify-center rounded font-semibold ${f?"mono ":""}${y}`.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,m]})},U_={orchestrator:bm,coder:MS,reviewer:pE,tester:Pl,sentinel:IS,custom:SE},W_={orchestrator:"crown",coder:"code",reviewer:"review",tester:"test",sentinel:"sentinel",custom:"custom"},I_={orchestrator:"var(--accent)",coder:"var(--status-blue)",reviewer:"var(--status-purple)",tester:"var(--status-orange)",sentinel:"var(--status-green)",custom:"var(--text-secondary)"},q_={working:"var(--status-green)",idle:"var(--text-tertiary)",stopped:"var(--status-red)"},P_=({role:t,size:a=32,statusRing:o="none"})=>{const i=U_[t];return c.jsx(Gw,{size:a,color:I_[t],ringColor:o==="none"?null:q_[o],ringSurface:"var(--bg-2)",testId:"role-avatar",data:{role:t,icon:W_[t],"status-ring":o},children:c.jsx(i,{size:Math.round(a*.56),"aria-hidden":!0})})},F_={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"},qwen:{src:"/cli-icons/qwen.png",surface:"#f4f8ff"}},K_={working:"var(--status-green)",idle:"var(--text-tertiary)",stopped:"var(--status-red)"},Xw=t=>t?F_[t]??null:null,xM=({commandPresetId:t,fallback:a=null,size:o=20,testId:i="cli-agent-logo"})=>{const l=Xw(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"}})})},Zw=({commandPresetId:t,workerRole:a,size:o=32,statusRing:i="none"})=>{const l=Xw(t);if(!l)return c.jsx(P_,{role:a,size:o,statusRing:i});const u=i==="none"?null:K_[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"}})})},Qw=({initialValue:t,saving:a,setSaving:o,onSave:i,onCancel:l,className:u})=>{const f=en(),[m,g]=b.useState(t),p=b.useRef(null),y=b.useRef(!1);b.useEffect(()=>{const T=setTimeout(()=>{p.current?.focus(),p.current?.select()},50);return()=>clearTimeout(T)},[]);const v=async()=>{const T=m.trim();if(!T||T===t){l();return}o(!0);try{const w=await i(T);if(w.error){f.show({kind:"error",message:w.error}),g(t),setTimeout(()=>{p.current?.focus(),p.current?.select()},50),o(!1);return}}catch(w){const E=w instanceof Error?w.message:"Failed to rename worker";f.show({kind:"error",message:E}),g(t),setTimeout(()=>{p.current?.focus(),p.current?.select()},50),o(!1);return}o(!1),l()},k=T=>{T.stopPropagation(),T.key==="Enter"?(T.preventDefault(),v()):T.key==="Escape"&&(T.preventDefault(),y.current=!0,l())},S=()=>{y.current||v()};return c.jsx("input",{ref:p,type:"text",value:m,disabled:a,onChange:T=>g(T.target.value),onKeyDown:k,onBlur:S,maxLength:64,className:u,onClick:T=>T.stopPropagation()})},Jw=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)"},kM=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)"},ex={working:"pill--green",idle:"pill--ghost",stopped:"pill--red"},tx=t=>`role.${t}`,nc=t=>t==="working"?"common.running":t==="idle"?"common.idle":"common.stopped",Y_=({hasRun:t,isPending:a=!1,isEditing:o=!1,onRenameWorker:i,onStartEditing:l,onCancelEditing:u,onAction:f,onClick:m,worker:g})=>{const{t:p}=we(),y=wt(),v=Jw(g),[k,S]=b.useState(!1),T=_=>N=>{if(N.stopPropagation(),_==="rename"){l?.();return}f?.(_,g)},w=g.ephemeral===!0&&g.spawnedBy==="workflow",E=g.ephemeral===!0&&g.spawnedBy==="orchestrator",C=w?"workflow":E?"orchestrator":null;if(y)return c.jsx(V_,{ephemeralTone:C,hasRun:t,isPending:a,onAction:f,onClick:m,status:v,worker:g,isEditing:o,onRenameWorker:i,onCancelEditing:u});const j=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":y?"true":void 0,children:[c.jsxs(j,{type:o?void 0:"button",onClick:o?void 0:()=>m(g),"aria-label":o?void 0:p("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:C?{borderStyle:"dashed",borderColor:C==="workflow"?"var(--accent)":"var(--border-bright)"}:void 0,children:[c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(Zw,{commandPresetId:g.commandPresetId,workerRole:g.role,size:40,statusRing:v.kind}),C?c.jsx("span",{className:"ml-auto rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide",style:{background:C==="workflow"?"color-mix(in oklab, var(--accent) 18%, transparent)":"color-mix(in oklab, var(--text-secondary) 14%, transparent)",color:C==="workflow"?"var(--accent)":"var(--text-secondary)"},"data-testid":"worker-card-ephemeral-badge",title:C==="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:C==="workflow"?"workflow":"temp"}):null]}),c.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[o?c.jsx(Qw,{initialValue:g.name,saving:k,setSaving:S,onSave:_=>i(g,_),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:p(tx(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 ${ex[v.kind]} worker-card__status`,role:"status",title:v.kind==="working"?p("worker.workingLegend"):p(nc(v.kind)),children:[c.jsx("span",{className:v.dotClass,"aria-hidden":!0}),p(nc(v.kind))]})})})]}),f?c.jsxs("div",{className:"worker-card__actions",children:[t?y?c.jsxs(c.Fragment,{children:[c.jsx(Os,{title:p("common.stop"),onClick:T("stop"),disabled:a,variant:"danger",testId:`worker-card-stop-${g.id}`,ariaLabel:p("worker.stopAria",{name:g.name}),children:c.jsx(Xb,{size:12,"aria-hidden":!0})}),c.jsx(Os,{title:p("common.restart"),onClick:T("restart"),disabled:a,testId:`worker-card-restart-${g.id}`,ariaLabel:p("worker.restartAria",{name:g.name}),children:c.jsx(km,{size:12,"aria-hidden":!0})})]}):null:c.jsx(Os,{title:p("common.start"),onClick:T("start"),disabled:a,variant:"primary",testId:`worker-card-start-${g.id}`,ariaLabel:p("worker.startAria",{name:g.name}),children:c.jsx(jo,{size:12,"aria-hidden":!0})}),c.jsx(Os,{title:p("worker.rename"),onClick:T("rename"),disabled:a||v.kind==="working",testId:`worker-card-rename-${g.id}`,ariaLabel:p("worker.renameAria",{name:g.name}),children:c.jsx(Vb,{size:12,"aria-hidden":!0})}),c.jsx(Os,{title:p("common.delete"),onClick:T("delete"),variant:"danger",testId:`worker-card-delete-${g.id}`,ariaLabel:p("worker.deleteAria",{name:g.name}),children:c.jsx(pc,{size:12,"aria-hidden":!0})})]}):null]})},Os=({ariaLabel:t,children:a,disabled:o,onClick:i,testId:l,title:u,variant:f="default"})=>c.jsx(Qe,{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})}),V_=({ephemeralTone:t,hasRun:a,isPending:o,onAction:i,onClick:l,status:u,worker:f,isEditing:m=!1,onRenameWorker:g,onCancelEditing:p})=>{const{t:y}=we(),[v,k]=b.useState(!1),[S,T]=b.useState(!1),w=b.useRef(!1),E=_=>{_==="rename"&&(w.current=!0),k(!1),i?.(_,f)},C=y(tx(f.role)),j=m?"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(j,{type:m?void 0:"button",onClick:m?void 0:()=>l(f),"aria-label":m?void 0:y("worker.open",{name:f.name}),className:`card worker-card flex w-full items-center gap-3 p-3 pr-12 text-left ${m?"":"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(Zw,{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:[m?c.jsx(Qw,{initialValue:f.name,saving:S,setSaving:T,onSave:_=>g(f,_),onCancel:()=>p?.(),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:C})]}),c.jsxs("span",{className:`pill ${ex[u.kind]} worker-card__status shrink-0`,role:"status",children:[c.jsx("span",{className:u.dotClass,"aria-hidden":!0}),y(nc(u.kind))]})]}),i?c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button","aria-label":y("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(BS,{size:18,"aria-hidden":!0})}),c.jsx(_o,{open:v,onOpenChange:k,children:c.jsxs(Ro,{children:[c.jsx(Oo,{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(Do,{onCloseAutoFocus:_=>{w.current&&(_.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(Mo,{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:y(nc(u.kind))})]}),c.jsx(ei,{className:"sr-only",children:y("worker.actionsAria",{name:f.name})}),a?c.jsxs(c.Fragment,{children:[c.jsx(Ds,{disabled:o,icon:c.jsx(Xb,{size:16,"aria-hidden":!0}),label:y("common.stop"),onSelect:()=>E("stop"),testId:`worker-card-stop-${f.id}`,danger:!0}),c.jsx(Ds,{disabled:o,icon:c.jsx(km,{size:16,"aria-hidden":!0}),label:y("common.restart"),onSelect:()=>E("restart"),testId:`worker-card-restart-${f.id}`})]}):c.jsx(Ds,{disabled:o,icon:c.jsx(jo,{size:16,"aria-hidden":!0}),label:y("common.start"),onSelect:()=>E("start"),testId:`worker-card-start-${f.id}`}),c.jsx(Ds,{disabled:o||u.kind==="working",icon:c.jsx(Vb,{size:16,"aria-hidden":!0}),label:y("worker.rename"),onSelect:()=>E("rename"),testId:`worker-card-rename-${f.id}`}),c.jsx(Ds,{icon:c.jsx(pc,{size:16,"aria-hidden":!0}),label:y("common.delete"),onSelect:()=>E("delete"),testId:`worker-card-delete-${f.id}`,danger:!0})]})})]})})]}):null]})},Ds=({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]}),$_=["working","idle","stopped"],qy=t=>t==="working"?"common.running":t==="idle"?"common.idle":"common.stopped",G_=t=>{const a={idle:[],working:[],stopped:[]};for(const o of t)a[Jw(o).kind].push(o);return{sections:$_.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}}},X_=({onAddWorkerClick:t,onDeleteWorker:a,onOpenShellTerminal:o,onOpenWorker:i,onRenameWorker:l,onStopWorker:u,onRestartWorker:f,onStartWorker:m,shellTerminalAvailable:g=!0,startingWorkerId:p,terminalRuns:y,workers:v,workspaceId:k})=>{const{t:S}=we(),{sections:T,summary:w}=b.useMemo(()=>G_(v),[v]),E=b.useMemo(()=>new Map(y.map(L=>[L.agent_id,L.run_id])),[y]),[C,j]=b.useState(null),[_,N]=b.useState(null),O=(L,U)=>{if(L==="start"){m(U);return}if(L==="stop"){const q=E.get(U.id);q&&u?.(q);return}if(L==="restart"){const q=E.get(U.id);q&&f?.(U.id,q);return}if(L==="rename"){N(U.id);return}L==="delete"&&j(U)},M=()=>{C&&(a(C),j(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(mc,{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(Jd,{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(ai,{icon:c.jsx(Jd,{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(Jd,{size:14,"aria-hidden":!0})," ",S("worker.emptyAdd")]})}),k?c.jsx(B_,{workspaceId:k}):null]}):c.jsx("div",{"data-testid":"worker-grid",children:T.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(qy(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(qy(L.kind))} team members`,className:"worker-card-grid",children:L.workers.map(U=>c.jsx("li",{children:c.jsx(Y_,{hasRun:E.has(U.id),isPending:p===U.id,isEditing:_===U.id,onRenameWorker:async(q,ae)=>v.some(F=>F.id!==q.id&&F.name.toLowerCase()===ae.toLowerCase())?{error:S("addWorker.agentExists")}:l(q,ae),onStartEditing:()=>N(U.id),onCancelEditing:()=>N(null),onAction:O,onClick:i,worker:U})},U.id))})]},L.kind))})}),c.jsx(ri,{open:C!==null,onOpenChange:L=>{L||j(null)},title:C?S("worker.deleteConfirm",{name:C.name}):"",description:C?S("worker.deleteDescription",{name:C.name}):"",confirmLabel:S("worker.deleteMember"),confirmKind:"danger",onConfirm:M})]})},Z_=b.lazy(()=>Nt(()=>import("./AddWorkerDialog-DFNkbR_Q.js"),__vite__mapDeps([2,3,4])).then(t=>({default:t.AddWorkerDialog}))),Q_=b.lazy(()=>Nt(()=>import("./WorkerModal-1y-Xdwv-.js"),[]).then(t=>({default:t.WorkerModal}))),J_=({activeWorkerId:t,onCreateWorker:a,onDeleteWorker:o,onDeleteWorkspace:i,onStartWorker:l,onStopWorker:u,onRestartWorker:f,onOrchestratorResult:m,onRequestAddWorkspace:g,onShellRunClosed:p,onShellRunStarted:y,onTryDemo:v,welcomeDisabledReason:k,orchestratorAutostartError:S,orchestratorAutostartRunId:T,terminalRuns:w,workers:E,workspace:C,onActiveWorkerChange:j,showInlineActionCenter:_=!0})=>{const{t:N}=we(),O=wt(),[M,L]=b.useState(null),U=t===void 0?M:t,q=b.useCallback(Ee=>{j?j(Ee):L(Ee)},[j]),[ae,ee]=b.useState(!1),[F,J]=b.useState("orchestrator"),X=zw();b.useEffect(()=>()=>Lw(!1),[]);const[V,D]=b.useState(null),[P,I]=b.useState(null),[$,Z]=b.useState(null),[R,B]=b.useState(!1),re=en(),ne=T_({createWorker:a,open:ae,workers:E}),de=v_({workspaceId:C?.id??"",terminalRuns:w,autostartError:S,suppressAutostartRunId:T,onClearAutostartError:()=>{C&&m(C.id,{ok:!0,error:null,run_id:null})},onAfterStart:Ee=>{C&&m(C.id,Ee)}}),fe=i_(),ue=E.find(Ee=>Ee.id===U)??null;b.useEffect(()=>{U&&!ue&&q(null)},[U,ue,q]);const ie=XA({workspaceId:C?.id??"",workers:E,terminalRuns:w}),le=ie.tabs.filter(Ee=>Ee.kind==="shell"),ce=C?w.filter(Ee=>bc(Ee,C.id)):[],{closeShellTab:me,openShell:Te,shellError:Ne,shellStarting:Se,startNewShell:rt}=o_({onCloseFailed:Ee=>re.show({kind:"error",message:N("shellTerminal.closeFailed",{message:Ee})}),onShellRunClosed:p,onShellRunStarted:y,panelTabs:ie,shellRuns:ce,workspaceId:C?.id??null});if(b.useEffect(()=>{ne.createWorkerError&&re.show({kind:"error",message:ne.createWorkerError})},[ne.createWorkerError,re]),b.useEffect(()=>{V&&re.show({kind:"error",message:V})},[V,re]),b.useEffect(()=>{P&&re.show({kind:"error",message:P})},[P,re]),b.useEffect(()=>{Ne&&re.show({kind:"error",message:Ne})},[Ne,re]),b.useEffect(()=>{q(null),D(null),I(null),Z(null),B(!1),J("orchestrator")},[C?.id,q]),!C){const Ee={onAddWorkspace:g};return v&&(Ee.onTryDemo=v),k&&(Ee.disabledReason=k),c.jsx(j_,{...Ee})}const xt=ue?r_(w,ue.id):void 0,Wt=Ee=>{D(null),o(Ee.id).then(()=>q(null)).catch(Be=>{D(Be instanceof Error?Be.message:String(Be))})},pn=Ee=>{I(null),Z(Ee.id),l(Ee.id).then(({error:Be})=>{Be&&I(Be)}).catch(Be=>{I(Be instanceof Error?Be.message:String(Be))}).finally(()=>Z(null))},hn=Ee=>{u(Ee).then(({error:Be})=>{Be&&re.show({kind:"error",message:Be})})},Tn=(Ee,Be)=>{I(null),Z(Ee),f(Ee,Be).then(({error:ft})=>{ft&&I(ft)}).catch(ft=>{I(ft instanceof Error?ft.message:String(ft))}).finally(()=>Z(null))},tn=async(Ee,Be)=>{try{return await rN(C.id,Ee.id,Be),re.show({kind:"success",message:N("worker.renameSuccess",{name:Be})}),{error:null}}catch(ft){const Za=ft instanceof Error?ft.message:String(ft);return re.show({kind:"error",message:N("worker.renameFailed",{message:Za})}),{error:Za}}},ke=`${(fe.orchPct*100).toFixed(2)}%`,pe=()=>{B(!1),Te()},Oe=()=>{B(!1),rt()},Xa=c.jsx(g_,{state:de.state,onRemoveWorkspace:()=>{i(C).catch(Ee=>{const Be=Ee instanceof Error?Ee.message:String(Ee);re.show({kind:"error",message:`Delete failed: ${Be}`})})},onStart:de.start,onRestart:de.restart}),Ho=c.jsxs("div",{className:"relative flex min-h-0 min-w-0 flex-1 flex-col",children:[c.jsx(X_,{onAddWorkerClick:()=>ee(!0),onDeleteWorker:Wt,onOpenShellTerminal:pe,onOpenWorker:Ee=>q(Ee.id),onRenameWorker:tn,onStartWorker:pn,onStopWorker:hn,onRestartWorker:Tn,startingWorkerId:$,terminalRuns:w,workers:E,workspaceId:C.id}),R?null:c.jsx(YA,{tabs:le,activeId:ie.activeId,scopeKey:C.id,onSelect:ie.setActive,onClose:Ee=>{Ee.startsWith("shell:")&&me(Ee.slice(6)),ie.closeTab(Ee)},onClosePanel:()=>B(!0),onNewShell:Oe,newShellPending:Se,onStartWorker:Ee=>{const Be=E.find(ft=>ft.id===Ee);Be&&pn(Be)},startingWorkerId:$})]});return c.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",style:{background:"var(--bg-2)"},children:[c.jsx(BA,{terminalRuns:w,workers:E,workspace:C}),_?c.jsx(NA,{workspaceId:C.id,onOpenWorker:q},C.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":N("mobile.nav.team"),className:"flex shrink-0 items-center gap-1 border-b p-2",style:{borderColor:"var(--border)"},children:[["orchestrator","workers"].map(Ee=>{const Be=F===Ee,ft=`mobile-team-tab-${Ee}`,Za=`mobile-team-panel-${Ee}`;return c.jsxs("button",{id:ft,type:"button",role:"tab","aria-selected":Be,"aria-controls":Za,tabIndex:Be?0:-1,"data-active":Be||void 0,"data-testid":ft,onClick:()=>J(Ee),className:"flex min-h-11 flex-1 items-center justify-center gap-1.5 rounded-md text-sm font-medium",style:Be?{background:"var(--accent)",color:"var(--bg-0)"}:{background:"var(--bg-3)",color:"var(--text-secondary)"},children:[c.jsx("span",{children:N(Ee==="orchestrator"?"mobile.team.orchestrator":"mobile.team.workers")}),Ee==="workers"&&E.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:Be?{background:"var(--bg-0)",color:"var(--accent)"}:{background:"var(--bg-1)",color:"var(--text-secondary)"},children:E.length}):null]},Ee)}),c.jsx("button",{type:"button",onClick:AA,"aria-pressed":X,"aria-label":N(X?"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:X?c.jsx(rE,{size:16,"aria-hidden":!0}):c.jsx(nE,{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":F!=="orchestrator",className:"mobile-team-pane flex min-h-0 min-w-0 flex-col","data-active":F==="orchestrator"?"true":"false",children:Xa}),c.jsx("div",{id:"mobile-team-panel-workers",role:"tabpanel","aria-labelledby":"mobile-team-tab-workers","aria-hidden":F!=="workers",className:"mobile-team-pane flex min-h-0 min-w-0 flex-col","data-active":F==="workers"?"true":"false",children:Ho})]})]}):c.jsxs("div",{ref:fe.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:ke},"data-testid":"orchestrator-pane-shell",children:Xa}),c.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":N("workerPane.resize"),"aria-valuenow":Math.round(fe.orchPct*100),"aria-valuemin":30,"aria-valuemax":78,tabIndex:0,className:"pane-splitter",style:{left:`calc(${ke} - 4px)`},"data-dragging":fe.dragging||void 0,"data-testid":"pane-splitter",onPointerDown:fe.beginDrag,onKeyDown:fe.onKeyDown}),Ho]}),ue?c.jsx(b.Suspense,{fallback:null,children:c.jsx(Q_,{onClose:()=>q(null),onStart:pn,runId:xt?.run_id??null,startError:P,starting:$===ue.id,worker:ue})}):null,ae?c.jsx(b.Suspense,{fallback:null,children:c.jsx(Z_,{commandPresets:ne.commandPresets,commandPresetId:ne.commandPresetId,creating:ne.creating,customTemplates:ne.customTemplates,onApplyMarketplaceImport:ne.applyMarketplaceImport,onClose:()=>ee(!1),onDeleteTemplate:ne.deleteTemplate,onNameChange:ne.setWorkerName,onPresetChange:ne.setCommandPresetId,onRandomName:ne.randomizeWorkerName,onRoleDescriptionChange:ne.setRoleDescription,onRoleDescriptionReset:ne.resetRoleDescription,onRoleChange:ne.setWorkerRole,onSaveAsTemplate:ne.saveAsTemplate,onSubmit:Ee=>ne.submit(Ee,()=>ee(!1)),onStartupCommandChange:ne.setStartupCommand,onTemplateChange:ne.selectTemplate,roleDescription:ne.roleDescription,roleDescriptionDefault:ne.roleDescriptionDefault,selectedTemplateId:ne.selectedTemplateId,startupCommand:ne.startupCommand,templateBusy:ne.templateBusy,workerName:ne.workerName,workerRole:ne.workerRole})}):null]})},e3=({activeId:t,activeWorkspace:a,activeWorkerId:o,bootstrapError:i,demoMode:l,onActiveWorkerChange:u,onDeleteWorkspace:f,onExitDemo:m,onRequestAddWorkspace:g,onShellRunClosed:p,onShellRunStarted:y,onTryDemo:v,orchestratorAutostartErrors:k,orchestratorAutostartRunIds:S,recordOrchestratorResult:T,terminalRuns:w,workerActions:E,workers:C,workspacesLoading:j,showInlineActionCenter:_})=>l?c.jsx(XE,{onExit:m}):j&&!a?c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx(Fa,{size:24,className:"animate-spin text-ter"})}):c.jsx(J_,{activeWorkerId:o,onCreateWorker:E.createWorker,onDeleteWorker:E.deleteWorker,onDeleteWorkspace:f,onStartWorker:E.startWorker,onStopWorker:E.stopWorkerRun,onRestartWorker:E.restartWorkerRun,onOrchestratorResult:T,onRequestAddWorkspace:g,onShellRunClosed:p,onShellRunStarted:y,onTryDemo:v,onActiveWorkerChange:u,welcomeDisabledReason:i??void 0,orchestratorAutostartError:t?k[t]??null:null,orchestratorAutostartRunId:t?S[t]??null:null,terminalRuns:w,workers:C,workspace:a,showInlineActionCenter:_}),Rl={id:"demo-workspace",name:"demo-todo-app",path:"/Users/you/demo-todo-app"},t3=[{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"}],n3=`# 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
|
+
`,a3=()=>{const[t,a]=b.useState(!1);return{demoMode:t,enableDemo:()=>a(!0),exitDemo:()=>a(!1)}},r3=t=>{const{demoMode:a,workspaces:o,activeWorkspaceId:i,workersByWorkspaceId:l}=t,u=a?[Rl]:o,f=a?{[Rl.id]:t3}:l,m=a?Rl.id:i,g=a?Rl:o?.find(y=>y.id===i);return{effectiveActiveWorkspaceId:m,effectiveWorkspaces:u,effectiveWorkersByWorkspaceId:f,effectiveActiveWorkspace:g,pollWorkspaceId:a?null:i}},o3=[{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"}],s3=[{descriptionKey:"notifications.detail.brief.description",labelKey:"notifications.detail.brief.label",value:"brief"},{descriptionKey:"notifications.detail.detailed.description",labelKey:"notifications.detail.detailed.label",value:"detailed"}],i3=()=>{const{t}=we(),a=wt(),[o,i]=b.useState(!1),l=b.useRef(null),u=b.useRef(null),{notify:f,previewSound:m,requestDesktopNotifications:g,settings:p,updateSettings:y}=Nc(),v=typeof window<"u"&&!("Notification"in window),k=b.useMemo(()=>o3.map(w=>({...w,description:t(w.descriptionKey),label:t(w.labelKey)})),[t]),S=b.useMemo(()=>s3.map(w=>({...w,description:t(w.descriptionKey),label:t(w.labelKey)})),[t]),T=w=>{if(!w){y({desktop:!1});return}g()};return b.useEffect(()=>{if(!o)return;const w=C=>{C.key==="Escape"&&(i(!1),u.current?.focus())},E=C=>{const j=l.current;j&&!j.contains(C.target)&&i(!1)};return document.addEventListener("keydown",w),document.addEventListener("pointerdown",E),()=>{document.removeEventListener("keydown",w),document.removeEventListener("pointerdown",E)}},[o]),c.jsxs("div",{ref:l,className:"relative",children:[c.jsx(Qe,{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(Uf,{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(Uf,{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(Ka,{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(Kl,{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:p.sound===w.value?`color-mix(in oklab, ${w.accent} 10%, var(--bg-2))`:"var(--bg-2)",borderColor:p.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:p.sound===w.value,className:"sr-only",onChange:()=>y({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(Zb,{size:12,"aria-hidden":!0}):c.jsx(Kl,{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,p.sound===w.value?c.jsx(Ga,{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:()=>m(w.value),children:c.jsx(jo,{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(Kb,{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:p.detail===w.value?"var(--bg-3)":"transparent",color:p.detail===w.value?"var(--text-primary)":"var(--text-secondary)"},children:[c.jsx("input",{type:"radio",name:"notification-detail",value:w.value,checked:p.detail===w.value,className:"sr-only",onChange:()=>y({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:p.desktop,disabled:v,className:"mt-0.5",onChange:w=>T(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]})},nx=({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"})}),l3=t=>Math.max(0,Math.ceil((t-Date.now())/1e3)),c3=()=>{const{t}=we(),[a,o]=b.useState(null),[i,l]=b.useState(!1),[u,f]=b.useState(!1),[m,g]=b.useState(()=>Date.now());b.useEffect(()=>{if(!a)return;const k=window.setInterval(()=>g(Date.now()),1e3);return()=>window.clearInterval(k)},[a]);const p=async()=>{f(!1),l(!0);try{const k=await vN();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:()=>{p()},disabled:i,className:"icon-btn icon-btn--primary flex items-center gap-1.5",children:[c.jsx($b,{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 y=l3(a.expiresAt),v=y<=0||m>=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:y})})]}),c.jsxs("div",{className:"flex gap-2",children:[v?c.jsx("button",{type:"button","data-testid":"remote-qr-regenerate",onClick:()=>{p()},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")})]})]})]})},u3={ok:"remote.audit.result.ok",rejected:"remote.audit.result.rejected",error:"remote.audit.result.error"},d3=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`},f3=()=>{const{t}=we(),[a,o]=b.useState(!1),[i,l]=b.useState(null),[u,f]=b.useState(!1),m=b.useCallback(async()=>{f(!1);try{l(await xN(100))}catch{f(!0)}},[]);return b.useEffect(()=>{a&&m()},[a,m]),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(dc,{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(No,{size:12,"aria-hidden":!0,className:"shrink-0 text-ter"}):c.jsx(fc,{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 p=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:p?{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:p?"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]}),p?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(u3[g.result]),g.rejectReason?` · ${g.rejectReason}`:""]}):null,c.jsx("span",{className:"shrink-0 tabular-nums text-ter",children:d3(g.ts)})]},g.id)})})}):null]})},Py=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`},m3=({reloadKey:t=0})=>{const{t:a}=we(),o=en(),[i,l]=b.useState(null),[u,f]=b.useState(!1),[m,g]=b.useState(null),p=b.useCallback(async()=>{f(!1);try{const k=await K0();l(k)}catch{f(!0)}},[]);b.useEffect(()=>{p()},[p,t]);const y=async k=>{try{await wN(k.deviceId),o.show({kind:"success",message:a("remote.devices.revoked",{name:k.name})}),await p()}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"):Py(k.lastActive)==="<1m"?a("remote.devices.activeNow"):a("remote.devices.lastActive",{ago:Py(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(ri,{open:m!==null,onOpenChange:k=>{k||g(null)},title:a("remote.devices.revokeTitle"),description:m?a("remote.devices.revokeConfirm",{name:m.name}):"",confirmLabel:a("remote.devices.revoke"),confirmKind:"danger",onConfirm:()=>{m&&y(m)}})]})},p3=2e3,Zf={enabled:!1,loggedIn:!1,gatewayUrl:null,connected:!1,connection:"disabled"},ax=b.createContext({status:Zf,loading:!0,setEnabled:async()=>{},pending:null,refresh:async()=>{}}),h3=({children:t})=>{const a=wt(),[o,i]=b.useState(Zf),[l,u]=b.useState(!0),[f,m]=b.useState(null);b.useEffect(()=>{let v=!1;return uf().then(k=>{v||i(k)}).catch(()=>{}).finally(()=>{v||u(!1)}),()=>{v=!0}},[]);const g=b.useCallback(async v=>{const k=await gN(v);i(k),k.enabled||m(null)},[]),p=b.useCallback(async()=>{const v=await uf().catch(()=>Zf);i(v),v.enabled&&v.loggedIn&&!a?m(await xy().catch(()=>null)):m(null)},[a]),y=o.enabled&&o.loggedIn&&!a;return b.useEffect(()=>{if(!y){m(null);return}let v=!1;const k=()=>{uf().then(T=>{v||i(T)}).catch(()=>{}),xy().then(T=>{v||m(T)}).catch(()=>{})};k();const S=window.setInterval(k,p3);return()=>{v=!0,window.clearInterval(S)}},[y]),c.jsx(ax.Provider,{value:{status:o,loading:l,setEnabled:g,pending:f,refresh:p},children:t})},qm=()=>b.useContext(ax),g3={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)"},v3={connecting:"remote.status.connecting",reconnecting:"remote.status.reconnecting",revoked:"remote.status.revoked"},y3=()=>{const{t}=we(),a=en(),o=wt(),{status:i,loading:l,setEnabled:u,pending:f}=qm(),m=g3[i.connection],g=v3[i.connection],[p,y]=b.useState(!1),[v,k]=b.useState(!1),[S,T]=b.useState(!1),[w,E]=b.useState(!1),[C,j]=b.useState(!1),[_,N]=b.useState(null),[O,M]=b.useState(!1),L=b.useRef(null),[U,q]=b.useState(0),ae=b.useRef(!1);b.useEffect(()=>{f?ae.current=!0:ae.current&&(ae.current=!1,q(I=>I+1))},[f]),b.useEffect(()=>()=>{L.current&&clearTimeout(L.current)},[]),b.useEffect(()=>{let I=!1;return NN().then($=>{I||(N($),M(!1))}).catch(()=>{I||M(!0)}),()=>{I=!0}},[]);const ee=async I=>{k(!1),y(!0);try{await u(I)}catch{k(!0)}finally{y(!1)}},F=I=>{if(!I&&o){T(!0);return}ee(I)},J=async()=>{if(!w){E(!0);try{const I=TN().then($=>JSON.stringify($,null,2));await V0(I),j(!0),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{j(!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{E(!1)}}},X=_?.current_streak_days??0,V=_?.days_active_total??0,D=_?.totals?.send??0,P=_?.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($b,{size:12,"aria-hidden":!0}),c.jsx("span",{children:t("remote.section")})]}),c.jsxs("div",{className:"settings-toggle-row",onClick:()=>{!l&&!p&&F(!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(nx,{checked:i.enabled,disabled:l||p,onChange:F,"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:J,disabled:w,className:"icon-btn mt-2 w-full justify-center pointer-coarse:min-h-11",children:[C?c.jsx(Ga,{size:12,"aria-hidden":!0}):c.jsx(Cr,{size:12,"aria-hidden":!0}),c.jsx("span",{children:t(w?"remote.diagnostics.copying":C?"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")}):_?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:X}),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:D}),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:m}}),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(c3,{}):null,c.jsx(m3,{reloadKey:U}),c.jsx(f3,{})]}):null,c.jsx(ri,{open:S,onOpenChange:I=>{I||T(!1)},title:t("remote.disable.confirmTitle"),description:t("remote.disable.confirmBody"),confirmLabel:t("common.stop"),confirmKind:"danger",onConfirm:()=>{ee(!1)}})]})},rx=b.createContext({enabled:!0,loading:!0,setEnabled:async()=>{}}),b3=({children:t})=>{const[a,o]=b.useState(!0),[i,l]=b.useState(!0);b.useEffect(()=>{let f=!1;return FT().then(m=>{f||o(m.enabled)}).catch(()=>{}).finally(()=>{f||l(!1)}),()=>{f=!0}},[]);const u=b.useCallback(async f=>{const m=await KT(f);o(m.enabled)},[]);return c.jsx(rx.Provider,{value:{enabled:a,loading:i,setEnabled:u},children:t})},w3=()=>b.useContext(rx),ox=b.createContext({enabled:!1,loading:!0,setEnabled:async()=>{}}),x3=({children:t})=>{const[a,o]=b.useState(!1),[i,l]=b.useState(!0);b.useEffect(()=>{let f=!1;return qT().then(m=>{f||o(m.enabled)}).catch(()=>{}).finally(()=>{f||l(!1)}),()=>{f=!0}},[]);const u=b.useCallback(async f=>{const m=await PT(f);o(m.enabled)},[]);return c.jsx(ox.Provider,{value:{enabled:a,loading:i,setEnabled:u},children:t})},sx=()=>b.useContext(ox),k3=()=>{const{language:t,setLanguage:a,t:o}=we();return c.jsxs("div",{className:"settings-section",children:[c.jsxs("div",{className:"settings-section__heading",children:[c.jsx(GS,{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"})]})]})},Fy=({feature:t,label:a,description:o,testId:i})=>{const{t:l}=we(),[u,f]=b.useState(!1),[m,g]=b.useState(!1),p=async y=>{g(!1),f(!0);try{await t.setEnabled(y)}catch{g(!0)}finally{f(!1)}};return c.jsxs("div",{className:"settings-toggle-row",onClick:()=>{!t.loading&&!u&&p(!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}),m?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(nx,{checked:t.enabled,disabled:t.loading||u,onChange:y=>{p(y)},"data-testid":i,"aria-label":a})})]})},S3=()=>{const{t}=we(),[a,o]=b.useState(""),[i,l]=b.useState(!1),[u,f]=b.useState(!1),[m,g]=b.useState(null);b.useEffect(()=>{let y=!1;return WT().then(v=>{y||(o(v),l(!0))}).catch(()=>{y||l(!0)}),()=>{y=!0}},[]);const p=async()=>{g(null),f(!0);try{await IT(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:y=>{g(null),o(y.target.value)},onBlur:()=>{p()},onKeyDown:y=>{if(y.key==="Enter"){if(y.nativeEvent.isComposing||y.keyCode===229)return;y.currentTarget.blur()}},"data-testid":"settings-webhook-url"}),m==="saved"?c.jsxs("span",{className:"mt-1.5 block text-xs",style:{color:"var(--status-green)"},children:["✓ ",t("settings.webhook.saved")]}):null,m==="error"?c.jsx("span",{className:"mt-1.5 block text-xs",style:{color:"var(--text-error)"},role:"alert",children:t("settings.saveError")}):null]})},ix=()=>{const{t}=we(),a=sx(),o=w3();return c.jsxs("div",{className:"flex flex-col gap-2.5",children:[c.jsx(k3,{}),c.jsxs("div",{className:"settings-section",children:[c.jsxs("div",{className:"settings-section__heading",children:[c.jsx(Pl,{size:12,"aria-hidden":!0}),c.jsx("span",{children:t("settings.experimental")})]}),c.jsx(Fy,{feature:a,label:t("settings.workflows.label"),description:t("settings.workflows.description"),testId:"settings-toggle-workflows"}),c.jsx(Fy,{feature:o,label:t("settings.autostaff.label"),description:t("settings.autostaff.description"),testId:"settings-toggle-autostaff"})]}),c.jsx(y3,{}),c.jsxs("div",{className:"settings-section",children:[c.jsxs("div",{className:"settings-section__heading",children:[c.jsx(HE,{size:12,"aria-hidden":!0}),c.jsx("span",{children:t("settings.webhook.label")})]}),c.jsx(S3,{})]})]})},lx=()=>{const{t}=we(),a=wt(),[o,i]=b.useState(!1),l=b.useRef(null),u=b.useRef(null);return b.useEffect(()=>{if(!o)return;const f=g=>{g.key==="Escape"&&(i(!1),u.current?.focus())},m=g=>{const p=l.current;p&&!p.contains(g.target)&&i(!1)};return document.addEventListener("keydown",f),document.addEventListener("pointerdown",m),()=>{document.removeEventListener("keydown",f),document.removeEventListener("pointerdown",m)}},[o]),c.jsxs("div",{ref:l,className:"relative",children:[c.jsx(Qe,{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(Wf,{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(Wf,{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(Ka,{size:16,"aria-hidden":!0})}):null]}),c.jsx(ix,{})]}):null]})},cx=t=>{const[a,o]=b.useState(null);return b.useEffect(()=>{if(t!==void 0)return;let i=!0;return MT().then(l=>{i&&o(l)}).catch(()=>{i&&o(null)}),()=>{i=!1}},[t]),t===void 0?a:t},E3="2.1.6",C3={version:E3},Pm=C3.version,T3=({actions:t,hideActions:a=!1,memoryOpen:o=!1,onToggleMemory:i,onToggleTaskGraph:l,openTaskCount:u=0,taskGraphOpen:f=!1,onToggleWorkflows:m,workflowsOpen:g=!1,version:p=Pm,versionInfo:y})=>{const{t:v}=we(),[k,S]=b.useState("idle"),T=cx(y),w=T?.updateAvailable&&T.latestVersion!==p?T:null,E=!!w?.installHint,C=u>0,j=f?v("topbar.hideTodo"):C?v("topbar.todoOpen",{count:u}):v("topbar.showTodo"),_=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)}},N=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",p]})]}),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",p," → v",w.latestVersion]}),E?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,E?c.jsx(Qe,{label:N,children:c.jsx("button",{type:"button",onClick:_,"aria-label":N,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(Ga,{size:12}):c.jsx(Cr,{size:12})})}):null,w.releaseUrl?c.jsx(Qe,{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(wm,{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(Qe,{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(fS,{size:13}),c.jsx("span",{children:v("topbar.memory")})]})}):null,l?c.jsx(Qe,{label:j,children:c.jsxs("button",{type:"button",onClick:l,"aria-pressed":f,"aria-label":j,"data-has-tasks":C?"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(Yb,{size:13,className:C?"text-accent":void 0}),c.jsx("span",{children:v("topbar.todo")})]})}):null,m?c.jsx(Qe,{label:v(g?"topbar.hideWorkflows":"topbar.showWorkflows"),children:c.jsxs("button",{type:"button",onClick:m,"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(Qb,{size:13}),c.jsx("span",{children:v("topbar.workflows")})]})}):null,c.jsx(i3,{}),c.jsx(lx,{})]})]})},ux="hive.workspace-sidebar.width",Vs=56,Fm=280,Ef=Vs,Ky=16,N3=240,Yy=96,Wl=t=>Math.min(Fm,Math.max(Vs,t)),j3=()=>{try{const t=localStorage.getItem(ux);if(!t)return Ef;const a=Number.parseInt(t,10);return Number.isFinite(a)?Wl(a):Ef}catch{return Ef}},A3=()=>{const[t,a]=b.useState(j3),[o,i]=b.useState(!1);b.useEffect(()=>{try{localStorage.setItem(ux,String(Math.round(t)))}catch{}},[t]);const l=b.useCallback(g=>{g.preventDefault();const p=g.clientX,y=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(Wl(y+w.clientX-p))},T=()=>{i(!1),document.body.style.cursor=v,document.body.style.userSelect=k,document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",T)};document.addEventListener("mousemove",S),document.addEventListener("mouseup",T)},[t]),u=t<=Yy,f=b.useCallback(()=>{a(g=>g<=Yy?N3:Vs)},[]),m=b.useCallback(g=>{g.key==="ArrowLeft"?(g.preventDefault(),a(p=>Wl(p-Ky))):g.key==="ArrowRight"?(g.preventDefault(),a(p=>Wl(p+Ky))):g.key==="Home"?(g.preventDefault(),a(Vs)):g.key==="End"&&(g.preventDefault(),a(Fm))},[]);return{beginResize:l,collapsed:u,onResizeKeyDown:m,resizing:o,toggleCollapsed:f,width:t}},_3=({children:t,hideTopbarActions:a=!1,memoryOpen:o=!1,onToggleMemory:i,onToggleTaskGraph:l,openTaskCount:u=0,onToggleWorkflows:f,workflowsOpen:m=!1,sidebar:g,sidebarResize:p,taskGraphOpen:y=!1,topbarActions:v,versionInfo:k})=>{const{t:S}=we();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(T3,{actions:v,hideActions:a,memoryOpen:o,onToggleMemory:i,onToggleTaskGraph:l,openTaskCount:u,taskGraphOpen:y,onToggleWorkflows:f,versionInfo:k,workflowsOpen:m}),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":p.resizing?"true":"false",style:{background:"var(--bg-0)",boxShadow:"inset -1px 0 0 var(--border)",width:`${p.width}px`},children:[g,c.jsx("hr",{"aria-label":S("layout.sidebarResizeAria"),"aria-orientation":"vertical","aria-valuemin":Vs,"aria-valuemax":Fm,"aria-valuenow":Math.round(p.width),tabIndex:0,className:"workspace-sidebar-resizer","data-resizing":p.resizing?"true":"false",onMouseDown:p.beginResize,onKeyDown:p.onResizeKeyDown})]}),c.jsx("section",{className:"relative flex min-w-0 flex-1 overflow-hidden",children:t})]})]})},R3={disconnected:"mobile.reconnect.disconnected",reconnecting:"mobile.reconnect.reconnecting",revoked:"mobile.reconnect.revoked"},O3=({status:t})=>{const{t:a}=we();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(R3[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]})},D3=[{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"}],M3=[{descriptionKey:"notifications.detail.brief.description",labelKey:"notifications.detail.brief.label",value:"brief"},{descriptionKey:"notifications.detail.detailed.description",labelKey:"notifications.detail.detailed.label",value:"detailed"}],L3=()=>{const{t}=we(),a=wt(),{notify:o,previewSound:i,requestDesktopNotifications:l,settings:u,updateSettings:f}=Nc(),m=typeof window<"u"&&!("Notification"in window),g=b.useMemo(()=>D3.map(v=>({...v,description:t(v.descriptionKey),label:t(v.labelKey)})),[t]),p=b.useMemo(()=>M3.map(v=>({...v,description:t(v.descriptionKey),label:t(v.labelKey)})),[t]),y=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(Uf,{size:12,"aria-hidden":!0}),c.jsx("span",{children:t("notifications.settings.heading")})]}),c.jsx(No,{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(Kl,{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(Zb,{size:12,"aria-hidden":!0}):c.jsx(Kl,{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(Ga,{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(jo,{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(Kb,{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:p.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:m,className:"mt-0.5 cursor-pointer",onChange:v=>y(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(m?"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")})})]})]})},z3=({demoMode:t,onTryDemo:a,onExitDemo:o})=>{const{t:i}=we();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(ix,{}),c.jsx(L3,{}),c.jsxs("div",{className:"settings-section mt-3",children:[c.jsxs("div",{className:"settings-section__heading",children:[c.jsx(Pl,{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(eE,{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(Pl,{size:16,"aria-hidden":!0,className:"text-ter"}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:i("mobile.section.demo")})]})]})]})},H3={team:hc,tasks:Yb,flows:Qb,settings:Wf},B3={team:"mobile.nav.team",tasks:"mobile.nav.tasks",flows:"mobile.nav.flows",settings:"mobile.nav.settings"},U3=({active:t,onSelect:a,sections:o,openTaskCount:i=0,workingCount:l=0})=>{const{t:u}=we();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 m=H3[f],g=u(B3[f]),p=f===t,y=f==="tasks"&&i>0?i:f==="team"&&l>0?l:0;return c.jsxs("button",{type:"button","aria-label":g,"aria-current":p?"page":void 0,"data-testid":`mobile-nav-${f}`,"data-active":p?"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:p?"var(--text-primary)":"var(--text-tertiary)"},children:[p?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(m,{size:20,"aria-hidden":!0}),c.jsx("span",{children:g}),y>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:y}):null]},f)})})},W3=({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]}),I3=()=>typeof navigator<"u"&&/iP(hone|ad|od)/.test(navigator.platform??navigator.userAgent),q3=()=>{const[t,a]=b.useState(null);return b.useEffect(()=>{if(!I3())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},P3={team:"mobile-section-team",tasks:"mobile-section-tasks",flows:"mobile-section-flows",settings:"mobile-section-settings"},F3=({workspaceSwitcher:t,topbarActions:a,banner:o,fullBleed:i,team:l,tasks:u,flows:f,settings:m,terminalPanels:g,overlays:p,openTaskCount:y=0,workingCount:v=0,activeSection:k,onSectionChange:S})=>{const[T,w]=b.useState("team"),E=k??T,C=q3(),j=U=>{w(U),S?.(U)},_={team:l,tasks:u,flows:f,settings:m},N=["team","tasks"];f!=null&&N.push("flows"),m!=null&&N.push("settings");const O=N.includes(E)?E:"team",L=zw()&&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)",...C!=null?{height:`${C}px`}:{}},children:[L?o:c.jsx(W3,{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":P3[O],"data-mobile-section":O,children:_[O]})}),g,i!=null||L?null:c.jsx(U3,{active:O,onSelect:j,sections:N,openTaskCount:y,workingCount:v}),p]})},K3=[],Y3=b.lazy(()=>Nt(()=>import("./TaskGraphDrawer-DQTS6JPI.js"),[]).then(t=>({default:t.TaskGraphContent}))),V3=({tasksFile:t,workspacePath:a,workers:o,onSelectOwner:i,onAddWorkspace:l,demoMode:u=!1})=>{const{t:f}=we(),m=o??K3,g=b.useMemo(()=>m.length?m.map(p=>p.name):void 0,[m]);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(b.Suspense,{fallback:null,children:c.jsx(Y3,{content:t.content,hasConflict:t.hasConflict,onContentChange:t.onChange,onKeepLocal:t.onKeepLocal,onReload:t.onReload,onSave:t.onSave,onToggleTaskLine:p=>{t.toggleTaskAtLine(p).catch(Ua("tasks.toggleTaskAtLine"))},onAppendTask:p=>{t.appendTask(p).catch(Ua("tasks.appendTask"))},onAppendSubtask:(p,y)=>{t.appendSubtask(p,y).catch(Ua("tasks.appendSubtask"))},onUpdateTaskText:(p,y)=>{t.updateTaskText(p,y).catch(Ua("tasks.updateTaskText"))},onDeleteTask:p=>{t.deleteTask(p).catch(Ua("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(ai,{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})})},Vy=[{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"}],$3=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)%Vy.length;return Vy[o]},G3=t=>{const a=t.trim();if(a.length===0)return"?";const o=a.codePointAt(0);return o===void 0?"?":String.fromCodePoint(o).toUpperCase()},Qf=({workspaceId:t,name:a,isActive:o,working:i,workingCount:l,size:u=32})=>{const{token:f,label:m}=$3(t),g=G3(a),p=l&&l>1?l:null;return c.jsx(Gw,{size:u,color:f,fontRatio:.45,ringColor:o?f:null,testId:"workspace-avatar",data:{"workspace-id":t,active:o?"true":void 0,"color-label":m},decoration:p!==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:p>9?"9+":p}):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})},$y=(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})},X3=({activeWorkspaceId:t,workspaces:a,workersByWorkspaceId:o,createDisabledReason:i,onSelectWorkspace:l,onCreateClick:u,onDeleteWorkspace:f})=>{const{t:m}=we(),g=en(),[p,y]=b.useState(!1),[v,k]=b.useState(null),[S,T]=b.useState(!1),w=a?.find(C=>C.id===t)?.name??m("mobile.section.workspaces"),E=()=>{if(!v||S)return;const C=v;T(!0),Promise.resolve(f(C)).then(()=>{g.show({kind:"success",message:m("sidebar.removed",{name:C.name})})}).catch(j=>{const _=j instanceof Error?j.message:String(j);g.show({kind:"error",message:m("sidebar.deleteFailed",{message:_})})}).finally(()=>{T(!1),k(null)})};return c.jsxs(_o,{open:p,onOpenChange:y,children:[c.jsx(NT,{asChild:!0,children:c.jsxs("button",{type:"button","data-testid":"mobile-workspace-switcher-trigger","aria-label":m("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(No,{size:16,"aria-hidden":!0,className:"shrink-0 text-ter"})]})}),c.jsxs(Ro,{children:[c.jsx(Oo,{"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(Do,{"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(Mo,{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:m("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:m("sidebar.noWorkspaces")}),c.jsx("span",{className:"text-xs text-ter",children:i??m("sidebar.noWorkspacesDesc")})]}):a.map(C=>{const j=C.id===t,_=o[C.id],N=_?.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-${C.id}`,onClick:()=>{y(!1),l(C.id)},className:"flex min-h-14 min-w-0 flex-1 items-center gap-3 px-4 py-2 text-left",style:j?{background:"color-mix(in oklab, var(--accent) 10%, transparent)"}:void 0,children:[c.jsx(Qf,{workspaceId:C.id,name:C.name,isActive:j,working:N>0,workingCount:N,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:C.name}),c.jsx("span",{className:"truncate text-xs text-ter",children:$y(_,m)})]}),j?c.jsx(Ga,{size:18,className:"shrink-0 text-accent","aria-hidden":!0}):null]}),c.jsx("button",{type:"button","aria-label":m("sidebar.deleteAria",{name:C.name}),"data-testid":`mobile-ws-delete-${C.id}`,onClick:()=>k(C),className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md text-ter",children:c.jsx(pc,{size:16,"aria-hidden":!0})})]},C.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:()=>{y(!1),u()},className:"icon-btn icon-btn--primary flex w-full min-h-11 items-center justify-center gap-1.5",children:[c.jsx(Fl,{size:16,"aria-hidden":!0}),m("sidebar.newWorkspace")]})})]})})]}),c.jsx(ri,{open:v!==null,onOpenChange:C=>{!C&&!S&&k(null)},title:v?m("sidebar.deleteConfirm",{name:v.name}):m("sidebar.deleteLabel"),description:v?m("sidebar.deleteDescription",{path:v.path,summary:$y(o[v.id],m)}):"",confirmLabel:m(S?"sidebar.deleting":"sidebar.deleteLabel"),confirmKind:"danger",onConfirm:E})]})},Z3=4e3,Q3=t=>{const[a,o]=b.useState([]);return b.useEffect(()=>{if(!t){o([]);return}let i=!1;const l=()=>{K0().then(f=>{i||o(f)}).catch(()=>{})};l();const u=window.setInterval(l,Z3);return()=>{i=!0,window.clearInterval(u)}},[t]),a},J3=({devices:t,enabled:a})=>{const{notify:o}=Nc(),{t:i}=we(),l=b.useRef(null);return b.useEffect(()=>{if(!a){l.current=null;return}const u=new Map(t.filter(m=>!m.revoked).map(m=>[m.deviceId,m])),f=l.current;if(l.current=new Set(u.keys()),!!f)for(const[m,g]of u)f.has(m)||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},eR=()=>{const{status:t}=qm(),a=t.enabled&&t.loggedIn,o=Q3(a);return c.jsx(J3,{devices:o,enabled:a})};let Jf=!1;const dx=()=>{Jf=!0,window.location.reload()},tR=t=>{b.useEffect(()=>{const a=o=>{if(Jf){Jf=!1;return}o.preventDefault(),o.returnValue=""};return window.addEventListener("beforeunload",a),()=>window.removeEventListener("beforeunload",a)},[t])},nR=3e3,aR=({onTryDemo:t}={})=>{const{t:a}=we(),[o,i]=b.useState(!1),l=b.useRef(!0),u=b.useCallback(()=>{typeof window>"u"||dx()},[]),f=b.useCallback(async()=>{try{return(await fetch("/api/version",{credentials:"include"})).ok}catch{return!1}},[]);b.useEffect(()=>{l.current=!0;const g=window.setInterval(async()=>{l.current&&await f()&&u()},nR);return()=>{l.current=!1,window.clearInterval(g)}},[f,u]);const m=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(yE,{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:()=>{m()},children:[o?c.jsx(Fa,{size:12,className:"animate-spin","aria-hidden":!0}):c.jsx(xm,{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(ES,{size:12,"aria-hidden":!0}),a("pwa.runtimeOffline.tryDemo")]}):null]}),c.jsx("div",{className:"text-ter text-xs",children:a("pwa.runtimeOffline.autoReconnect")})]})})},em=new Set;let fx=null;const rR=t=>{fx=t;for(const a of em)a(t)},oR=t=>(em.add(t),t(fx),()=>{em.delete(t)}),sR=2e3,iR=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&&rR(()=>{l.postMessage({type:"SKIP_WAITING"}),setTimeout(t.reload,sR)})};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())})},lR=()=>typeof navigator>"u"||typeof window>"u"?Promise.resolve():iR({isProd:!0,serviceWorker:"serviceWorker"in navigator?navigator.serviceWorker:null,reload:dx}),Gy=({terminalRuns:t})=>{const{t:a}=we(),o=wt(),[i,l]=b.useState(null),[u,f]=b.useState(!1);if(b.useEffect(()=>oR(y=>{l(()=>y)}),[]),!i)return null;const m=t.every(y=>y.status==="stopped"),g=!m||u,p=a(u?"pwa.reloading":m?"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(xm,{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(m?"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:p})]})},cR=new Set(["add-workspace","try-demo"]),uR=t=>t!==null&&cR.has(t),dR=({onAddWorkspace:t,onTryDemo:a,ready:o})=>{const i=b.useRef(!1);b.useEffect(()=>{if(!o||i.current||typeof window>"u")return;const u=new URLSearchParams(window.location.search).get("action");uR(u)&&(i.current=!0,window.history.replaceState({},"",window.location.pathname),u==="add-workspace"?t():u==="try-demo"&&a())},[o,t,a])},Xy=()=>{const{t}=we(),a=en(),o=wt(),{pending:i,refresh:l}=qm(),[u,f]=b.useState(!1),m=b.useRef(!1),g=i?.deviceName??"",p=i?.pairingId??null,y=i?.expiresAt??null;b.useEffect(()=>{p!==null&&(m.current=!1)},[p]);const v=b.useCallback(async()=>{if(!(!p||u||m.current)){m.current=!0,f(!0);try{await yN(p),a.show({kind:"success",message:t("remote.confirm.paired",{name:g})})}catch{m.current=!1,a.show({kind:"error",message:t("remote.confirm.failed")})}finally{f(!1),await l()}}},[p,u,g,l,t,a]),k=b.useCallback(async S=>{if(!(!p||m.current)){m.current=!0;try{await bN(p)}catch{}a.show({kind:S==="expired"?"warning":"success",message:t(S==="expired"?"remote.confirm.expired":"remote.confirm.rejected")}),f(!1),await l()}},[p,l,t,a]);return b.useEffect(()=>{if(y===null)return;const S=y-Date.now();if(S<=0){k("expired");return}const T=window.setTimeout(()=>{k("expired")},S);return()=>window.clearTimeout(T)},[y,k]),!i||o?null:c.jsx(_o,{open:!0,onOpenChange:S=>{S||k("rejected")},children:c.jsxs(Ro,{children:[c.jsx(Oo,{"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(Do,{"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(xE,{size:18})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx(Mo,{className:"text-lg font-semibold text-pri",children:t("remote.confirm.title")}),c.jsx(ei,{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")})]})]})})]})})},fR=t=>!!t?.some(a=>a.status==="working"),mR=t=>t?.filter(a=>a.status==="working").length??0,pR=(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})},mx="hive.sidebar.githubDismissed",hR="https://www.bilibili.com/video/BV1UHLp6nEQR",gR=()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(mx)==="1"}catch{return!1}},vR=({activeWorkspaceId:t,collapsed:a=!1,createDisabledReason:o,onCreateClick:i,onDeleteWorkspace:l,onSelectWorkspace:u,onToggleCollapse:f,workersByWorkspaceId:m,workspaces:g})=>{const{t:p}=we(),[y,v]=b.useState(null),[k,S]=b.useState(!1),[T,w]=b.useState(gR),E=en(),C=()=>{w(!0);try{window.localStorage.setItem(mx,"1")}catch{}},j=!!o,_=M=>{v(M)},N=()=>{if(!y||k)return;const M=y;S(!0),Promise.resolve(l(M)).then(()=>{E.show({kind:"success",message:p("sidebar.removed",{name:M.name})})}).catch(L=>{const U=L instanceof Error?L.message:String(L);E.show({kind:"error",message:p("sidebar.deleteFailed",{message:U})})}).finally(()=>{S(!1),v(null)})},O=c.jsx(ri,{open:y!==null,onOpenChange:M=>{!M&&!k&&v(null)},title:y?p("sidebar.deleteConfirm",{name:y.name}):p("sidebar.deleteLabel"),description:y?p("sidebar.deleteDescription",{path:y.path,summary:pR(m[y.id],p)}):"",confirmLabel:p(k?"sidebar.deleting":"sidebar.deleteLabel"),confirmKind:"danger",onConfirm:N});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:p("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(Qe,{side:"right",label:p(a?"layout.sidebarExpand":"layout.sidebarCollapse"),children:c.jsx("button",{type:"button","aria-label":p(a?"layout.sidebarExpand":"layout.sidebarCollapse"),"aria-expanded":!a,"data-testid":"workspace-sidebar-toggle",onClick:f,className:"ws-collapse-toggle",children:a?c.jsx(xS,{size:16,"aria-hidden":!0}):c.jsx(bS,{size:16,"aria-hidden":!0})})}):null]}),g===null?c.jsx("p",{className:"px-3 py-2 text-xs text-ter",children:p("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(ai,{title:p("sidebar.noWorkspaces"),description:o??p("sidebar.noWorkspacesDesc"),icon:c.jsx(Fb,{size:20}),action:c.jsxs("button",{type:"button",onClick:j?void 0:i,disabled:j,"aria-label":p("sidebar.newWorkspace"),title:o??p("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(Fl,{size:14,"aria-hidden":!0}),p("sidebar.newWorkspace")]})})})}):c.jsxs("ul",{className:"flex-1 scroll-y pb-2",children:[g.map(M=>{const L=m[M.id],U=M.id===t,q=fR(L),ae=mR(L);return c.jsxs("li",{className:"group relative",children:[c.jsx(Qe,{side:"right",label:c.jsxs("span",{className:"flex flex-col gap-0.5",children:[c.jsx("span",{className:"font-medium",children:M.name}),c.jsx("span",{className:"mono text-ter",children:M.path})]}),children:c.jsxs("button",{type:"button","aria-label":M.name,"aria-current":U?"true":void 0,"data-workspace-path":M.path,onClick:()=>u(M.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${U?" active":""}`,children:[c.jsx(Qf,{workspaceId:M.id,name:M.name,isActive:!1,working:q,workingCount:ae}),c.jsx("span",{className:`min-w-0 flex-1 truncate text-sm ${U?"font-medium text-pri":"text-pri"}`,children:M.name})]})}),c.jsx(Qe,{side:"right",label:c.jsxs("span",{className:"flex flex-col gap-0.5",children:[c.jsx("span",{className:"font-medium",children:M.name}),c.jsx("span",{className:"mono text-ter",children:M.path})]}),children:c.jsx("button",{type:"button","aria-label":M.name,"aria-current":U?"true":void 0,onClick:()=>u(M.id),className:"ws-avatar-cell hidden w-full justify-center py-2","data-testid":"ws-avatar-cell",children:c.jsx(Qf,{workspaceId:M.id,name:M.name,isActive:U,working:q,workingCount:ae})})}),c.jsx(Qe,{label:p("sidebar.deleteAria",{name:M.name}),children:c.jsx("button",{type:"button","aria-label":p("sidebar.deleteAria",{name:M.name}),onClick:()=>_(M),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(pc,{size:14,"aria-hidden":!0})})})]},M.id)}),c.jsx("li",{children:c.jsx(Qe,{label:o??p("sidebar.newWorkspace"),children:c.jsxs("button",{type:"button",onClick:j?void 0:i,disabled:j,"aria-label":p("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(Fl,{size:14,"aria-hidden":!0}),c.jsx("span",{className:"ws-add__label",children:p("sidebar.newWorkspace")})]})})})]}),T?null:c.jsxs("div",{className:"ws-sidebar-footer group relative",children:[c.jsxs("a",{href:hR,target:"_blank",rel:"noopener noreferrer","aria-label":p("sidebar.openDemoVideo"),title:p("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:p("sidebar.demoVideo")})]}),c.jsxs("a",{href:"https://github.com/tt-a1i/hive",target:"_blank",rel:"noopener noreferrer","aria-label":p("sidebar.openRepository"),title:p("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":p("sidebar.dismissRepository"),title:p("sidebar.dismissRepository"),onClick:C,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(Ka,{size:10,"aria-hidden":!0})})]}),O]})},Bn=/^(\s*)-\s+\[( |x|X)\]\s+(.*)$/,yR=/(?:^|[\s\p{P}])(@[A-Za-z0-9_-]+)/gu,bR=t=>{const a=[];for(const o of t.matchAll(yR))o[1]&&a.push(o[1]);return a},wR=t=>{const a=new Map;for(const o of t){const i=o.trim();i&&a.set(i.toLowerCase(),i)}return a},SM=(t,a={})=>{const o=[],i=[],l=t.split(/\r?\n/),u=a.knownWorkerNames?wR(a.knownWorkerNames):null;for(let f=0;f<l.length;f++){const m=l[f];if(!m)continue;const g=m.match(Bn);if(!g)continue;const[,p="",y=" ",v=""]=g,k=p.replace(/\t/g," ").length,S=bR(v);let T;if(u){T=[];for(const j of S){const _=u.get(j.slice(1).toLowerCase());_&&T.push(`@${_}`)}}else T=S;let w=v;for(const j of T){const _=j.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");w=w.replace(new RegExp(`(?:^|(?<=\\s|\\p{P}))${_}(?!\\w)`,"u"),"")}w=w.replace(/\s+/g," ").trim();const E={checked:y.toLowerCase()==="x",children:[],indent:k,line:f,mentions:T,text:w};for(;i.length>0;){const j=i[i.length-1];if(j&&j.indent<k)break;i.pop()}const C=i[i.length-1];C?C.children.push(E):o.push(E),i.push(E)}return o},xR=t=>{let a=0;const o=[],i=t.split(/\r?\n/);for(const l of i){if(!l)continue;const u=l.match(Bn);if(!u)continue;const[,f="",m=" "]=u,g=f.replace(/\t/g," ").length;for(;o.length>0;){const p=o[o.length-1];if(p&&p.indent<g)break;o.pop()}!o[o.length-1]&&m.toLowerCase()!=="x"&&(a+=1),o.push({indent:g})}return a},EM=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}},oi=t=>t.includes(`\r
|
|
81
|
+
`)?`\r
|
|
82
|
+
`:`
|
|
83
|
+
`,kR=(t,a)=>{const o=oi(t),i=t.length>0&&!t.endsWith(`
|
|
84
|
+
`);return`${t}${i?o:""}- [ ] ${a}${o}`},SR=(t,a)=>{const o=t.split(/\r?\n/),i=o[a];if(i===void 0)return t;const l=i.match(Bn);if(!l)return t;const u=(l[2]??" ").toLowerCase()==="x",f=i.replace(Bn,(m,g,p,y)=>`${g}- [${u?" ":"x"}] ${y}`);return o[a]=f,o.join(oi(t))},px=t=>t.replace(/\r?\n/g," ").replace(/\s+/g," ").trim(),ER=(t,a,o)=>{const i=t.split(/\r?\n/),l=i[a];if(l===void 0||!l.match(Bn))return t;const f=px(o);if(!f)return t;const m=l.replace(Bn,(g,p,y)=>`${p}- [${y}] ${f}`);return i[a]=m,i.join(oi(t))},CR=(t,a)=>{const o=t.split(/\r?\n/),i=o[a];if(i===void 0)return t;const l=i.match(Bn);if(!l)return t;const u=(l[1]??"").replace(/\t/g," ").length;let f=a+1;for(;f<o.length;){const m=o[f];if(m===void 0)break;const g=m.match(Bn);if(!g||(g[1]??"").replace(/\t/g," ").length<=u)break;f+=1}return o.splice(a,f-a),o.join(oi(t))},TR=(t,a,o)=>{const i=px(o);if(!i)return t;const l=t.split(/\r?\n/),u=l[a];if(u===void 0)return t;const f=u.match(Bn);if(!f)return t;const m=f[1]??"",g=m.replace(/\t/g," ").length;let p=a+1;for(;p<l.length;){const v=l[p];if(v===void 0)break;const k=v.match(Bn);if(!k||(k[1]??"").replace(/\t/g," ").length<=g)break;p+=1}const y=`${m} `;return l.splice(p,0,`${y}- [ ] ${i}`),l.join(oi(t))},NR=(t,a,o)=>t===a||t===o,jR=(t,a)=>{const[o,i]=b.useState(""),[l,u]=b.useState(!1),[f,m]=b.useState(!1),[g,p]=b.useState(null),y=b.useRef(!1),v=b.useRef(""),k=b.useRef(""),S=b.useCallback((w,E)=>{if(!y.current){v.current=w,k.current=w,i(w),m(!1),p(null);return}NR(w,v.current,E)||(p(w),m(!0))},[]);if(b.useEffect(()=>{if(!t){i(""),u(!1),m(!1),p(null),y.current=!1,v.current="",k.current="";return}let w=!1;return i(""),u(!1),m(!1),p(null),y.current=!1,v.current="",k.current="",oN(t).then(({content:E})=>{w||(v.current=E,y.current=!1,k.current=E,i(E),u(!0),m(!1),p(null))}).catch(E=>{w||(v.current="",y.current=!1,k.current="",i(""),u(!0),m(!1),console.error("[hive] swallowed:tasks.initialLoad",E),p(null))}),()=>{w=!0}},[t]),b.useEffect(()=>{if(!t)return;let w=!1,E=null,C=0,j=null;const _=()=>{if(w)return;const N=z0().openWebSocket(`/ws/tasks/${t}`);j=N,N.onmessage=O=>{if(w)return;const M=JSON.parse(String(O.data));M.type!=="tasks-snapshot"&&M.type!=="tasks-updated"||typeof M.content=="string"&&(C=0,S(M.content,k.current))},N.onclose=()=>{if(w)return;C+=1;const O=Math.min(3e4,500*2**(C-1));E=setTimeout(_,O)}};return _(),()=>{w=!0,E!==null&&(clearTimeout(E),E=null),j?.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,E)=>{},updateTaskText:async(w,E)=>{},deleteTask:async w=>{}};const T=async(w,E)=>{if(!t)return;const C=k.current,j=w(C);if(j!==C){v.current=j,k.current=j,y.current=!1,i(j);try{const _=await jl(t,{content:j});v.current=_.content,k.current=_.content,i(_.content)}catch(_){throw v.current=C,k.current=C,i(C),console.error(`[hive] swallowed:tasks.${E}`,_),_}}};return{content:o,hasConflict:f,loaded:l,onChange:w=>{y.current=w!==v.current,k.current=w,i(w)},onKeepLocal:()=>{m(!1),p(null)},onReload:()=>{const w=g??v.current;v.current=w,y.current=!1,k.current=w,i(w),m(!1),p(null)},onSave:async()=>{if(!t)return;const w=await jl(t,{content:o});v.current=w.content,y.current=!1,k.current=w.content,i(w.content),m(!1),p(null)},toggleTaskAtLine:async w=>{if(!t)return;const E=k.current,C=SR(E,w);if(C!==E){v.current=C,k.current=C,y.current=!1,i(C);try{const j=await jl(t,{content:C});v.current=j.content,k.current=j.content,i(j.content)}catch(j){throw v.current=E,k.current=E,i(E),j}}},appendTask:async w=>{const E=w.trim();if(!t||!E)return;const C=k.current,j=kR(C,E);v.current=j,k.current=j,y.current=!1,i(j);try{const _=await jl(t,{content:j});v.current=_.content,k.current=_.content,i(_.content)}catch(_){throw v.current=C,k.current=C,i(C),_}},appendSubtask:async(w,E)=>{const C=E.trim();C&&await T(j=>TR(j,w,C),"appendSubtask")},updateTaskText:async(w,E)=>{const C=E.trim();C&&await T(j=>ER(j,w,C),"updateTaskText")},deleteTask:async w=>{await T(E=>CR(E,w),"deleteTask")}}},AR=3e3,hx=(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&&bc(u,o)?!0:!l.has(u.agent_id))]},_R=(t,a)=>{const[o,i]=b.useState({}),l=b.useRef(new Map);b.useEffect(()=>()=>{for(const p of l.current.values())window.clearTimeout(p);l.current.clear()},[]);const u=b.useCallback((p,y)=>{i(v=>({...v,[p]:(v[p]??[]).filter(k=>k.agent_id!==y)}))},[]),f=b.useCallback((p,y)=>{const v=l.current.get(y);v&&window.clearTimeout(v),l.current.delete(y),i(k=>({...k,[p]:(k[p]??[]).filter(S=>S.run_id!==y)}))},[]);b.useEffect(()=>{if(!t||a.length===0)return;const p=new Set(a.map(y=>y.run_id));i(y=>{const v=y[t]??[],k=v.filter(S=>{if(!p.has(S.run_id))return!0;const T=l.current.get(S.run_id);return T&&window.clearTimeout(T),l.current.delete(S.run_id),!1});return k.length===v.length?y:{...y,[t]:k}})},[a,t]);const m=b.useCallback(({agentId:p,agentName:y,runId:v,status:k="starting",terminalInputProfile:S="default",workspaceId:T})=>{const w={agent_id:p,agent_name:y,run_id:v,status:k,terminal_input_profile:S};i(j=>{const _=bc(w,T),N=(j[T]??[]).filter(O=>O.run_id===w.run_id?!1:_?!0:O.agent_id!==w.agent_id);return{...j,[T]:[...N,w]}});const E=l.current.get(v);E&&window.clearTimeout(E);const C=window.setTimeout(()=>{i(j=>({...j,[T]:(j[T]??[]).filter(_=>_.run_id!==v)})),l.current.delete(v)},AR);l.current.set(v,C)},[]),g=b.useMemo(()=>hx(a,t?o[t]??[]:[],t),[a,o,t]);return{forgetOptimisticAgent:u,forgetOptimisticRun:f,optimisticRunsByWorkspaceId:o,recordOptimisticRun:m,terminalRuns:g}};let gx=null;const tm=new Set,RR=t=>{gx=t;for(const a of tm)a()},OR=t=>(tm.add(t),()=>tm.delete(t)),DR=()=>gx,vx="hive.package-update.dismissed-version",MR=()=>{try{return window.localStorage.getItem(vx)}catch{return null}},LR=t=>{try{window.localStorage.setItem(vx,t)}catch{}},Zy=({currentVersion:t=Pm,versionInfo:a})=>{const{t:o}=we(),i=wt(),[l,u]=b.useState(MR),[f,m]=b.useState("idle"),g=a?.updateAvailable&&a.latestVersion!==t?a:null;if(!g||l===g.latestVersion)return null;const p=!!g.installHint,y=o(f==="copied"?"packageUpdate.commandCopied":f==="error"?"packageUpdate.commandCopyFailed":"packageUpdate.copyCommand"),v=()=>{LR(g.latestVersion),u(g.latestVersion)},k=async()=>{if(g.installHint)try{await navigator.clipboard.writeText(g.installHint),m("copied"),window.setTimeout(()=>m("idle"),1600)}catch{m("error"),window.setTimeout(()=>m("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(sE,{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})}),p?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:[p?c.jsxs("button",{type:"button",className:"icon-btn icon-btn--primary","data-testid":"package-update-copy-command",onClick:k,"aria-label":y,title:y,children:[f==="copied"?c.jsx(Ga,{size:13}):c.jsx(Cr,{size:13}),c.jsx("span",{children:y})]}):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(wm,{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(Qe,{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(Ka,{size:13})})})]})},zR=(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,HR=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"))},BR=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),UR=(t,a)=>a?t.metaKey:t.ctrlKey,WR=(t,a,o=BR)=>!(t.key.toLowerCase()!==a.key||(a.mod??!1)!==UR(t,o)||(a.alt??!1)!==t.altKey||(a.shift??!1)!==t.shiftKey),IR=t=>{b.useEffect(()=>{const a=o=>{if(!HR(o.target))for(const i of t){if(!WR(o,i))continue;i.handler(o)!==!1&&o.preventDefault();return}};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t])},qR=({bootstrapError:t,onSelectWorkspace:a,onTriggerAddDialog:o,workspaces:i})=>{const l=b.useMemo(()=>{if(!zR())return[];const u=(i??[]).slice(0,9).map((f,m)=>({key:String(m+1),mod:!0,handler:()=>a(f.id)}));return[{key:"n",mod:!0,shift:!0,handler:()=>{t||o()}},...u]},[t,a,o,i]);IR(l)},PR=15e3,FR=async(t,a=PR)=>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))})}),KR=(t,a)=>a&&t.some(o=>o.id===a)?a:t[0]?.id??null,YR=(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())},VR=(t,a,o)=>{b.useEffect(()=>{let i=!1;const l=U0().then(async()=>{const[u,f]=await Promise.all([DT(),UT().catch(()=>null)]);return{items:u,persistedId:f}});return FR(l).then(({items:u,persistedId:f})=>{i||t(m=>{const g=YR(m,u),p=KR(g,f);return a(p),f!==p&&I0(p).catch(y=>{console.error("[hive] swallowed:initSession.save",y)}),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])},$R=()=>{const t=b.useRef(null);return b.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))},[])},GR=({onWorkspaceCreated:t,onError:a})=>{const{language:o}=we(),[i,l]=b.useState({}),[u,f]=b.useState({}),m=b.useCallback((p,y)=>{l(v=>({...v,[p]:y.ok?null:y.error})),f(v=>({...v,[p]:y.ok?y.run_id:null}))},[]),g=b.useCallback(async p=>{try{const y=await zT({name:p.name,path:p.path,autostart_orchestrator:!0,command_preset_id:p.commandPresetId,startup_command:p.startupCommand??null,ui_language:o});return m(y.id,y.orchestrator_start),t({id:y.id,name:y.name,path:y.path}),y}catch(y){const v=y instanceof Error?y.message:"Failed to create workspace";throw a?.(v),y}},[o,t,a,m]);return{orchestratorAutostartErrors:i,orchestratorAutostartRunIds:u,recordOrchestratorResult:m,createNewWorkspace:g}},XR=(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},ZR=({activeWorkspaceId:t,onActiveDeleted:a,selectWorkspace:o,setWorkersByWorkspaceId:i,setWorkspaces:l,workspaces:u})=>async f=>{const g=XR(u??[],f.id);await HT(f.id),l(p=>p?.filter(y=>y.id!==f.id)??p),i(p=>{const y={...p};return delete y[f.id],y}),f.id===t&&(a(),o(g))},QR=()=>{const[t,a]=b.useState(null),o=b.useRef(Promise.resolve());return{activeWorkspaceId:t,selectWorkspace:l=>{a(l),o.current=o.current.catch(Ua("selectWorkspace.prevQueue")).then(()=>I0(l)).catch(Ua("selectWorkspace.save"))},setActiveWorkspaceId:a}},yx=500,JR=5e3,e4=5e3,t4=()=>({failureCount:0,inFlight:!1,lastSettledAt:null}),n4=(t,a)=>Math.min((a?yx:JR)*2**t,e4),a4=(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}),Qy=(t,a)=>{const o=Object.keys(t),i=Object.keys(a);return o.length!==i.length?!1:i.every(l=>Object.hasOwn(t,l)&&a4(t[l]??[],a[l]??[]))},r4=(t,a={})=>{const o=t.join("\0"),i=b.useRef(a.activeWorkspaceId),l=b.useRef(new Map),u=b.useRef(null),[f,m]=b.useState({});return i.current=a.activeWorkspaceId,b.useEffect(()=>{if(!o){m({}),l.current.clear();return}let g=!1,p;const y=o.split("\0"),v=new Set(y);for(const C of l.current.keys())v.has(C)||l.current.delete(C);m(C=>{const j={};for(const _ of y)j[_]=C[_]??[];return Qy(C,j)?C:j});const k=C=>{let j=l.current.get(C);return j||(j=t4(),l.current.set(C,j)),j},S=C=>i.current===C,T=C=>{const j=k(C);j.inFlight||(j.inFlight=!0,YT(C).then(_=>{g||(j.failureCount=0,m(N=>{if(!v.has(C))return N;const O={};for(const M of y)O[M]=M===C?_:N[M]??[];return Qy(N,O)?N:O}))}).catch(_=>{g||(j.failureCount=Math.min(j.failureCount+1,4),console.error("[hive] swallowed:workspaceWorkers.list",_))}).finally(()=>{j.inFlight=!1,j.lastSettledAt=g?null:Date.now()}))},w=()=>{const C=Date.now();for(const j of y){const _=k(j);if(_.inFlight)continue;if(_.lastSettledAt===null){T(j);continue}const N=n4(_.failureCount,S(j));C-_.lastSettledAt>=N&&T(j)}},E=(C=yx)=>{g||(p!==void 0&&window.clearTimeout(p),p=window.setTimeout(()=>{p=void 0,w(),E()},C))};return u.current=()=>{p!==void 0&&(window.clearTimeout(p),p=void 0),w(),E()},w(),E(),()=>{g=!0,p!==void 0&&window.clearTimeout(p),u.current&&(u.current=null)}},[o]),b.useEffect(()=>{const g=a.activeWorkspaceId;if(!g||!o.split("\0").includes(g))return;const p=l.current.get(g);p&&!p.inFlight&&(p.lastSettledAt=null,p.failureCount=0),u.current?.()},[a.activeWorkspaceId,o]),[f,m]},nm="hive:terminal-visible-resize",o4=t=>new CustomEvent(nm,{detail:{runId:t}}),s4="\x1B[200~",Jy="\x1B[201~",i4=(t,a)=>{const o=t.split(Jy).join("");return a?.modes?.bracketedPasteMode===!1?o:`${s4}${o}${Jy}`},Hn="\x1B",eb="\x07",l4=new RegExp(`${Hn}\\[[0-?]*[ -/]*[@-~]`,"gu"),c4=new RegExp(`${Hn}\\][^${eb}${Hn}]*(?:${eb}|${Hn}\\\\)`,"gu"),u4=new RegExp("[\0-]","gu"),d4=new RegExp(`${Hn}\\[([0135]) q`,"gu"),f4=new RegExp(`${Hn}\\[[0135] q`,"u"),m4=new RegExp(`${Hn}\\[[0-?]*K`,"u"),p4=t=>{switch(t){case"3":return"4";case"5":return"6";default:return"2"}},h4=t=>t.replace(c4,"").replace(l4,"").replace(u4,""),g4=t=>h4(t).trim().length>0,v4=t=>!g4(t)&&t.includes(`${Hn}[?2026`)&&t.includes(`${Hn}[?25`)&&f4.test(t)&&m4.test(t),tb=t=>({chunk:t.replace(d4,(a,o)=>`${Hn}[${p4(o)} q`),suppress:v4(t)}),y4=(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)},m=T=>T.data||t.value,g=T=>T.inputType==="insertText"||T.inputType==="insertFromComposition"||T.inputType==="insertReplacementText"||T.inputType==="insertDictationResult",p=()=>{i=!0,l=!1,a.setComposing(!0)},y=()=>{i=!0,a.setComposing(!0)},v=T=>{const E=T.data||t.value;!l&&E&&a.commit(E),u(),f()},k=T=>{const w=T;if(i||w.isComposing){if(g(w)){const E=m(w);E&&(a.commit(E),l=!0),u()}return}w.defaultPrevented&&g(w)&&u()},S={capture:!0};return t.addEventListener("compositionstart",p,S),t.addEventListener("compositionupdate",y,S),t.addEventListener("compositionend",v,S),t.addEventListener("input",k,S),()=>{o!==void 0&&clearTimeout(o),t.removeEventListener("compositionstart",p,S),t.removeEventListener("compositionupdate",y,S),t.removeEventListener("compositionend",v,S),t.removeEventListener("input",k,S)}},b4=()=>typeof navigator>"u"?!1:/Mac|iPhone|iPad/.test(navigator.platform),On={killToLineStart:"",lineStart:"",lineEnd:"",killWordBack:"\x1B",wordBack:"\x1Bb",wordForward:"\x1Bf",shiftEnter:"\x1B[13;2u"},w4=(t,a={})=>{const o=a.isMac??b4();if(t.key==="Enter"&&t.shiftKey)return t.type==="keypress"?{kind:"send",bytes:On.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:On.killToLineStart};case"ArrowLeft":return{kind:"send",bytes:On.lineStart};case"ArrowRight":return{kind:"send",bytes:On.lineEnd};case"k":case"K":return{kind:"clear"}}if(l)switch(t.key){case"Backspace":return{kind:"send",bytes:On.killWordBack};case"ArrowLeft":return{kind:"send",bytes:On.wordBack};case"ArrowRight":return{kind:"send",bytes:On.wordForward}}return{kind:"passthrough"}},x4=16,k4=.3,S4={up:"A",down:"B",right:"C",left:"D"},am=(t,a)=>{const o=S4[a];return t?`\x1BO${o}`:`\x1B[${o}`},E4=(t,a,o)=>a==="codex"||a==="grok"||a==="opencode"?o==="up"?"\x1B[5~":"\x1B[6~":am(t.modes?.applicationCursorKeysMode,o),C4=t=>t==="codex"||t==="grok"||t==="opencode",bx=(t,a="default")=>{let o=0;return i=>{if(t.buffer?.active?.type!=="alternate")return o=0,{handled:!1,input:null};if(!C4(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/=x4,Math.abs(i.deltaY)<50&&(l*=k4),o+=l,l=Math.trunc(o),o%=1):o=0,l===0?{handled:!0,input:null}:{handled:!0,input:E4(t,a,l<0?"up":"down")}}},T4=({element:t,profile:a="default",sendInput:o,terminal:i})=>{const l=bx(i,a),u=m=>{const{handled:g,input:p}=l(m);return g?(m.preventDefault(),m.stopPropagation(),p&&o(p),!1):!0};if(typeof i.attachCustomWheelEventHandler=="function")return i.attachCustomWheelEventHandler(u),()=>{};const f=m=>{u(m)||m.stopImmediatePropagation()};return t.addEventListener("wheel",f,{capture:!0,passive:!1}),()=>t.removeEventListener("wheel",f,{capture:!0})},N4=(t,a={})=>{switch(t){case"esc":return"\x1B";case"tab":return" ";case"enter":return"\r";case"arrowUp":return am(a.applicationCursorKeys,"up");case"arrowDown":return am(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 On.killToLineStart;case"ctrlA":return On.lineStart;case"ctrlE":return On.lineEnd;case"ctrlW":return""}},j4="Invalid terminal control message",A4=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 m=crypto.randomUUID(),g={...t,clientId:m},p=z0(),y=p.openWebSocket(`/ws/terminal/${f}/io`,g),v=p.openWebSocket(`/ws/terminal/${f}/control`,g);let k=!1,S=!1,T=!1;const w=[];let E=null;const C=()=>{S||T||(T=!0,u?.())};y.onclose=C,v.onclose=C;const j=()=>{!E||v.readyState!==v.OPEN||(v.send(JSON.stringify({type:"resize",...E})),E=null)};return y.onmessage=_=>{const N=typeof _.data=="string"?_.data:"",O=M=>{v.readyState===v.OPEN&&v.send(JSON.stringify({type:"output_ack",bytes:M}))};if(!k){w.push({chunk:N,acknowledge:O});return}i(N,O)},v.onopen=()=>{j()},v.onmessage=_=>{const N=A4(_.data);if(!N){a(j4);return}if(N.type==="exit"&&o(N.code),N.type==="error"&&a(N.message),N.type==="restore"){l(N.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,y.close(),v.close()},resize(_,N,O,M){E={cols:_,rows:N},O!==void 0&&(E.pixelWidth=O),M!==void 0&&(E.pixelHeight=M),j()},sendBinaryInput(_){if(y.readyState!==y.OPEN)return;const N=new Uint8Array(_.length);for(let O=0;O<_.length;O++)N[O]=_.charCodeAt(O)&255;y.send(N)},sendInput(_){y.readyState===y.OPEN&&y.send(_)}}},R4=16,O4=.08,D4=.96,M4=.025,nb=5,L4=100,z4=8,H4=6,B4=4,U4=.5,W4=250,I4=24,q4=2,P4=".xterm-viewport",F4=".xterm-screen";function K4({element:t,profile:a="default",sendInput:o,terminal:i}){let l=null,u=0,f=0,m,g=0,p=null,y=0,v=!1,k=null,S=null,T=R4,w=0,E=0,C=null,j=[];const _=bx(i,a),N=()=>{p!==null&&(window.cancelAnimationFrame(p),p=null)},O=()=>{C!==null&&(window.cancelAnimationFrame(C),C=null)},M=()=>(k?.isConnected||(k=t.querySelector(P4)),k),L=()=>(S?.isConnected||(S=t.querySelector(F4)),S),U=()=>{const ie=M(),le=i.rows;if(!ie||!le||le<=0)return;const ce=ie.clientHeight/le;ce>=6&&ce<=64&&(T=ce)},q=()=>{const ie=L();ie&&(ie.style.transform=w!==0?`translateY(${-w}px)`:"")},ae=()=>{w!==0&&(w=0,q())},ee=()=>{if(Math.abs(w)>=T/2){const ie=M();if(ie){const le=ie.scrollHeight-ie.clientHeight,ce=w>0?T:-T;ie.scrollTop=Math.min(le,Math.max(0,ie.scrollTop+ce))}}ae()},F=ie=>{const le=M();if(!le)return"missing";const ce=le.scrollHeight-le.clientHeight;if(ce<=0)return ae(),"stuck";const me=w+ie,Te=Math.trunc(me/T);let Ne=me-Te*T;const Se=le.scrollTop,rt=Math.min(ce,Math.max(0,Se+Te*T)),xt=rt!==Se;xt&&(le.scrollTop=rt),(rt<=0&&me<0||rt>=ce&&me>0)&&(Ne=0);const Wt=Ne!==w;return w=Ne,Wt&&q(),xt||Wt?"moved":"stuck"},J=ie=>{u+=ie/T;const le=Math.trunc(u);return u%=1,le===0||i.scrollLines?.(le),!0},X=(ie,le)=>{const ce=[];for(let me=0;me<le;me++){const{handled:Te,input:Ne}=_({deltaMode:WheelEvent.DOM_DELTA_LINE,deltaY:ie,shiftKey:!1});if(!Te)break;Ne&&ce.push(Ne)}return ce.length>0&&o(ce.join("")),ce.length},V=ie=>{f+=ie/T;const le=Math.trunc(f);if(f%=1,le===0)return!1;const ce=a==="codex"||a==="opencode"?B4:H4;return X(le<0?-1:1,Math.min(Math.abs(le),ce))>0},D=ie=>{const le=i.buffer?.active?.type;return le!==m&&(u=0,f=0,m=le,ae()),le==="alternate"?{moved:V(ie),normalBuffer:!1}:{moved:F(ie)==="moved"||J(ie),normalBuffer:!0}},P=()=>{C=null;const ie=E;E=0,ie!==0&&(v=D(ie).normalBuffer)},I=()=>{C===null&&(C=window.requestAnimationFrame(P))},$=(ie,le)=>{j.push({t:ie,y:le}),j.length>z4&&j.shift()},Z=ie=>{const le=ie-L4,ce=j.filter(rt=>rt.t>=le),me=ce[0],Te=ce[ce.length-1];if(!me||!Te||me===Te)return 0;const Ne=Te.t-me.t;if(Ne<=0)return 0;const Se=(me.y-Te.y)/Ne;return Math.max(-nb,Math.min(nb,Se))};let R=0;const B=()=>{if(p=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),q4);if(X(ie,le)<le){R=0;return}R-=ie*le,R!==0&&(p=window.requestAnimationFrame(B))},re=ie=>{const le=Math.min(32,Math.max(1,ie-y));y=ie;const{moved:ce,normalBuffer:me}=D(g*le);if(!ce||!me){p=null,u=0,g=0,ee();return}if(g*=D4**(le/16.67),Math.abs(g)<M4){p=null,u=0,ee();return}p=window.requestAnimationFrame(re)},ne=ie=>{N(),R=0,O(),E=0,j=[],l=ie.touches.length===1?ie.touches[0]?.clientY??null:null,l!==null&&$(ie.timeStamp,l),g=0,v=!1,M(),U()},de=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(),E+=ce,$(ie.timeStamp,le),I())},fe=ie=>{l=null,O(),P();const le=Z(ie.timeStamp);if(j=[],v&&Math.abs(le)>=O4){g=le,y=performance.now(),p=window.requestAnimationFrame(re);return}if(!v&&a!=="opencode"&&Math.abs(le)>=U4&&i.buffer?.active?.type==="alternate"){const ce=Math.min(I4,Math.round(Math.abs(le)*W4/T));if(ce>0){R=le>0?ce:-ce,p=window.requestAnimationFrame(B);return}}g=0,u=0,ee()},ue=()=>{N(),R=0,O(),E=0,j=[],l=null,u=0,f=0,g=0,v=!1,ae()};return t.addEventListener("touchstart",ne,{passive:!0}),t.addEventListener("touchmove",de,{passive:!1}),t.addEventListener("touchend",fe,{passive:!0}),t.addEventListener("touchcancel",ue,{passive:!0}),()=>{t.removeEventListener("touchstart",ne),t.removeEventListener("touchmove",de),t.removeEventListener("touchend",fe),t.removeEventListener("touchcancel",ue),N(),O(),ae()}}const Y4=(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}},V4=t=>t instanceof Error&&t.message?`Terminal failed to load: ${t.message}`:"Terminal failed to load. Refresh this page and try again.",$4=new RegExp("\x1B\\[M([\\s\\S])([\\s\\S])([\\s\\S])","g"),G4=new TextEncoder,X4=(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}`},Z4=(t,a)=>{if(a!=="grok"&&a!=="opencode")return{binary:!0,chunk:t};const o=t.replace($4,X4);return{binary:o===t,chunk:o}},Q4=(t,a="default")=>{const o=wt(),i=b.useRef(null),[l,u]=b.useState(null),[f,m]=b.useState("connecting"),g=b.useRef("connecting"),[p,y]=b.useState(0),v=b.useRef(null),k=b.useRef(null),S=b.useRef(!1),[T,w]=b.useState("canvas"),[E,C]=b.useState(!1),j=b.useRef(!1),_=b.useCallback(U=>{w(U);const q=i.current;q&&(q.dataset.renderer=U)},[]),N=b.useCallback(U=>{S.current||v.current?.sendInput(U)},[]),O=b.useCallback(U=>{const q=k.current?.modes?.applicationCursorKeysMode;N(N4(U,q===void 0?{}:{applicationCursorKeys:q}))},[N]),M=b.useCallback(U=>{const q=i4(U,k.current??void 0);return v.current?.sendInput(q),q},[]),L=b.useCallback(()=>{const U=()=>{k.current?.scrollToBottom();const q=i.current?.querySelector(".xterm-viewport");q&&(q.scrollTop=q.scrollHeight)};U(),window.requestAnimationFrame(()=>{U(),window.requestAnimationFrame(U)}),window.setTimeout(U,80),j.current=!1,C(!1)},[]);return b.useEffect(()=>{if(!i.current)return;let U=!1,q,ae,ee,F,J,X,V,D,P,I,$,Z=null,R,B,re,ne,de;u(null),g.current="connecting",m("connecting"),j.current=!1,C(!1);const fe=ue=>{g.current!==ue&&(g.current=ue,m(ue))};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(([ue,ie,le,ce])=>{if(U||!i.current)return;const me=typeof window<"u"?getComputedStyle(document.documentElement):null,Te=me?.getPropertyValue("--bg-crust").trim()||"#0e0e0e",Ne=me?.getPropertyValue("--text-primary").trim()||"#ebebeb",Se=new ue.Terminal({allowProposedApi:!0,convertEol:!1,fontFamily:"'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:o?12:13,letterSpacing:0,lineHeight:1,scrollback:1e4,theme:{background:Te,foreground:Ne}}),rt=new ie.FitAddon;Se.loadAddon(rt),Se.loadAddon(new le.Unicode11Addon),Se.unicode.activeVersion="11",Se.loadAddon(new ce.ClipboardAddon),Se.open(i.current),_("canvas"),rt.fit(),X=Se,k.current=Se,V=rt;const xt=()=>{const ke=Se.buffer.active,pe=ke.viewportY<ke.baseY;j.current!==pe&&(j.current=pe,C(pe))},Wt=()=>{ne===void 0&&(ne=window.requestAnimationFrame(()=>{ne=void 0,xt()}))};B=Se.onScroll(Wt),re=Se.buffer.onBufferChange(Wt),I=T4({element:i.current,profile:a,sendInput:ke=>J?.sendInput(ke),terminal:Se}),o&&($=K4({element:i.current,profile:a,sendInput:ke=>J?.sendInput(ke),terminal:Se})),Z=i.current.querySelector(".xterm-helper-textarea"),Z&&(R=y4(Z,{setComposing:ke=>{S.current=ke},commit:ke=>J?.sendInput(ke)})),typeof Se.attachCustomKeyEventHandler=="function"&&Se.attachCustomKeyEventHandler(ke=>{const pe=w4(ke,{hasSelection:Se.hasSelection()});switch(pe.kind){case"send":return ke.preventDefault(),J?.sendInput(pe.bytes),!1;case"clear":return ke.preventDefault(),Se.clear(),!1;case"copy":{ke.preventDefault();const Oe=Se.getSelection();return Oe&&navigator.clipboard?.writeText(Oe).catch(()=>{}),Se.clearSelection(),!1}case"block":return!1;case"passthrough":return!0}});const pn=()=>{const ke=i.current;return ke?.isConnected?!ke.closest('[data-terminal-host-parked="true"]'):!1},hn=()=>{if(!i.current)return{};const ke=i.current.clientWidth,pe=i.current.clientHeight,Oe={};return pe>0&&(Oe.pixelHeight=pe),ke>0&&(Oe.pixelWidth=ke),Oe},Tn=()=>{if(!i.current||!pn())return;const ke=hn();if(!ke.pixelHeight||!ke.pixelWidth||de&&de.pixelHeight===ke.pixelHeight&&de.pixelWidth===ke.pixelWidth)return;V?.fit();const pe={cols:X?.cols??80,rows:X?.rows??24,...hn()};de&&de.cols===pe.cols&&de.rows===pe.rows&&de.pixelHeight===pe.pixelHeight&&de.pixelWidth===pe.pixelWidth||(de=pe,J?.resize(pe.cols,pe.rows,pe.pixelWidth,pe.pixelHeight))},tn=()=>{P&&window.clearTimeout(P),P=window.setTimeout(()=>{P=void 0,Tn()},50)};Nt(()=>import("./addon-web-links-DIbG5aQx.js"),[]).then(ke=>{U||X!==Se||Se.loadAddon(new ke.WebLinksAddon)}).catch(()=>{}),Y4()&&Nt(()=>import("./addon-webgl-DCtw1yLn.js"),[]).then(ke=>{if(!(U||X!==Se))try{const pe=new ke.WebglAddon;pe.onContextLoss(()=>{pe.dispose(),_("canvas")}),Se.loadAddon(pe),_("webgl"),tn()}catch{_("canvas")}}).catch(()=>{_("canvas")}),J=_4({initialSize:{cols:Se.cols,rows:Se.rows,...hn()},onError(ke){u(ke)},onExit(){fe("stopped")},onOutput(ke,pe){fe("running");const Oe=G4.encode(ke).byteLength;if(a==="codex"){const Xa=tb(ke);if(Xa.suppress){pe(Oe);return}Se.write(Xa.chunk,()=>pe(Oe));return}Se.write(ke,()=>pe(Oe))},onRestore(ke){fe("running"),Se.write(a==="codex"?tb(ke).chunk:ke)},onClose(){U||y(ke=>ke+1)},runId:t}),v.current=J,F=Se.onData(ke=>{S.current||J?.sendInput(ke)}),typeof Se.onBinary=="function"&&(ee=Se.onBinary(ke=>{const pe=Z4(ke,a);pe.binary?J?.sendBinaryInput(pe.chunk):J?.sendInput(pe.chunk)})),Tn(),typeof ResizeObserver<"u"&&i.current&&(D=new ResizeObserver(tn),D.observe(i.current)),q=ke=>{ke.detail?.runId===t&&tn()},ae=()=>tn(),window.addEventListener(nm,q),window.addEventListener("resize",ae)}).catch(ue=>{U||(u(V4(ue)),fe("stopped"))}),()=>{U=!0,q&&window.removeEventListener(nm,q),ae&&window.removeEventListener("resize",ae),D?.disconnect(),P&&window.clearTimeout(P),I?.(),$?.(),R?.(),ne!==void 0&&window.cancelAnimationFrame(ne),B?.dispose(),re?.dispose(),ee?.dispose(),F?.dispose(),J?.dispose(),X?.dispose(),V?.dispose(),v.current=null,k.current=null}},[t,a,p]),{containerRef:i,error:l,status:f,sendInput:N,sendKey:O,beginPaste:M,renderer:T,isScrolledUp:E,scrollToBottom:L}},J4={connecting:"terminal.statusConnecting",running:"terminal.statusRunning",stopped:"common.stopped"},rm="hive-terminal-parking-lot",e5=500,t5=t=>[`worker-pty-${t}`,`orch-pty-${t}`,`shell-pty-${t}`],n5=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},a5=t=>{const a=Array.from(document.querySelectorAll("[data-pty-slot]")).filter(o=>o.id===t&&o.isConnected&&!n5(o));return a[a.length-1]??null},r5=()=>{let t=document.getElementById(rm);return t||(t=document.createElement("div"),t.id=rm,t.hidden=!0,t.style.display="none",(document.body??document.documentElement).appendChild(t)),t},Cf=()=>{const t=document.getElementById(rm);t&&t.childElementCount===0&&t.remove()},Il=new Set;let Is,qs;const ab=()=>{for(const t of Il)t()},o5=()=>{Is?.disconnect(),Is=void 0,qs!==void 0&&(window.clearInterval(qs),qs=void 0)},s5=()=>{if(Is||qs!==void 0)return;const t=document.body??document.documentElement;if(typeof MutationObserver<"u"&&t){Is=new MutationObserver(ab),Is.observe(t,{attributeFilter:["aria-hidden","class","data-pty-slot","hidden","id","style"],attributes:!0,childList:!0,subtree:!0});return}qs=window.setInterval(ab,100)},i5=t=>(Il.add(t),s5(),()=>{Il.delete(t),Il.size===0&&o5()}),l5=[50,150,300],c5=t=>{const a=[],o=[],i=()=>window.dispatchEvent(o4(t)),l=(u,f)=>{const m=window.setTimeout(()=>{const g=o.indexOf(m);g>=0&&o.splice(g,1),f()},u);o.push(m)};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 l5)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}},u5=t=>{const[a,o]=b.useState(null);return b.useEffect(()=>{const i=t5(t),l=()=>{for(const f of i){const m=a5(f);if(m)return m}return null},u=()=>{const f=l();o(m=>m===f?m:f)};return u(),i5(u)},[t]),a},d5=(t,a)=>{const[o,i]=b.useState(!1),[l,u]=b.useState(null),f=b.useRef(void 0),m=b.useRef(null),g=b.useRef(void 0),p=b.useCallback(()=>{f.current!==void 0&&(window.clearTimeout(f.current),f.current=void 0)},[]),y=b.useCallback(()=>{g.current?.(),g.current=void 0},[]);return b.useLayoutEffect(()=>{const v=document.createElement("div");return v.dataset.terminalHostRunId=t,v.dataset.terminalHostParked="false",v.className="h-full min-h-0 w-full min-w-0",m.current=v,u(v),()=>{p(),y(),v.remove(),m.current=null,Cf()}},[p,y,t]),b.useLayoutEffect(()=>{if(a){p(),i(!0);return}if(!(!o||f.current!==void 0))return f.current=window.setTimeout(()=>{f.current=void 0,i(!1)},e5),p},[o,p,a]),b.useLayoutEffect(()=>{const v=m.current;if(!v)return;if(!o){y(),v.remove(),v.dataset.terminalHostParked="false",Cf();return}const k=a??r5();if(v.parentElement===k)return;const S=v.parentElement!==null,T=document.activeElement;a||y(),!a&&T instanceof HTMLElement&&v.contains(T)&&T.blur(),v.dataset.terminalHostParked=a?"false":"true",k.appendChild(v),Cf(),a&&S&&(y(),g.current=c5(t))},[o,y,t,a]),o?l:null},f5=({inputProfile:t="default",runId:a,startupBlockedReason:o,title:i})=>{const l=u5(a),u=d5(a,l);return u?gc.createPortal(c.jsx(m5,{inputProfile:t,runId:a,startupBlockedReason:o??null,title:i}),u):null},m5=({inputProfile:t,runId:a,startupBlockedReason:o,title:i})=>{const{t:l}=we(),u=wt(),{containerRef:f,error:m,status:g,isScrolledUp:p,scrollToBottom:y}=Q4(a,t),v=J4[g],k=b.useCallback(()=>{f.current?.querySelector(".xterm-helper-textarea")?.blur(),y()},[f,y]);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:v?l(v):g}),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&&o==="first_run_setup"?c.jsx("p",{className:"mono shrink-0 break-words px-3 py-2 text-xs","data-testid":`terminal-startup-setup-${a}`,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:l("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-${a}`,ref:f,className:"bg-crust h-full min-h-0 w-full min-w-0 overflow-hidden"}),!m&&g==="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:l("terminal.statusConnecting")}):null,u&&p?c.jsx(p5,{label:l("terminal.scrollToBottom"),onJump:k}):null]})]})},p5=({label:t,onJump:a})=>{const o=b.useRef(null),i=b.useRef(Number.NEGATIVE_INFINITY),l=b.useCallback(u=>{u.preventDefault?.(),u.stopPropagation?.();const f=u.timeStamp??performance.now();f-i.current<250||(i.current=f,a())},[a]);return b.useEffect(()=>{const u=o.current;if(!u)return;const f=m=>{m.cancelable&&m.preventDefault(),m.stopImmediatePropagation(),l(m)};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})},h5=({hidden:t=!1,optimisticRuns:a=[],terminalRuns:o,workspaceId:i})=>{const{t:l}=we(),u=hx(o,a,i);return c.jsx("section",{hidden:t,"aria-hidden":t||void 0,"aria-label":l("terminalPanels.aria"),children:u.map(f=>c.jsx(f5,{inputProfile:f.terminal_input_profile??"default",runId:f.run_id,startupBlockedReason:f.startup_blocked_reason??null,title:`${f.agent_name} (${f.status})`},f.run_id))})},g5=[{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 对原子保存编辑器也更宽容。"]}],rb=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}},Tf=(t,a)=>{const o=rb(t),i=rb(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},v5=(t,a,o=g5)=>{if(a===null)return{show:!1,entries:[],seedOnly:!0};if(Tf(t,a)<=0)return{show:!1,entries:[],seedOnly:!1};const i=o.filter(l=>Tf(l.version,a)>0&&Tf(l.version,t)<=0);return i.length===0?{show:!1,entries:[],seedOnly:!0}:{show:!0,entries:i,seedOnly:!1}},wx="hive.last-seen-version",y5="1.7.0",b5=(t,a)=>{try{const o=window.localStorage.getItem(wx);return o||(a?y5:null)}catch{return t}},ob=t=>{try{window.localStorage.setItem(wx,t)}catch{}},w5=({hasExistingWorkspace:t,wizardOpen:a})=>{const o=Pm,[i,l]=b.useState(void 0);b.useEffect(()=>{i!==void 0||t===null||l(b5(o,t))},[t,i]);const u=b.useMemo(()=>i===void 0?{show:!1,entries:[],seedOnly:!1}:v5(o,i),[i]),[f,m]=b.useState(!1);b.useEffect(()=>{u.seedOnly&&ob(o)},[u.seedOnly]);const g=b.useCallback(()=>{ob(o),m(!0)},[]);return{open:u.show&&!f&&!a,entries:u.entries,close:g}},sb="hive.first-run-seen",x5=()=>{const[t,a]=b.useState(()=>{try{return window.localStorage.getItem(sb)==="1"}catch{return!0}}),o=b.useCallback(()=>{try{window.localStorage.setItem(sb,"1")}catch{}a(!0)},[]);return{seen:t,markSeen:o}},k5=t=>{const{seen:a,markSeen:o}=x5(),[i,l]=b.useState(!1);b.useEffect(()=>{!a&&t!==null&&t.length===0&&l(!0)},[a,t]);const u=b.useCallback((f=!0)=>{f&&o(),l(!1)},[o]);return{wizardOpen:i,closeWizard:u}},S5=(t,a)=>t.findIndex(i=>i.id===a.id)===-1?[...t,a]:t.map(i=>i.id===a.id?a:i),xx=t=>t==="codex"?"codex":t==="grok"?"grok":t==="opencode"?"opencode":"default",ib=(t,a)=>xx(t.find(o=>o.id===a)?.commandPresetId),E5=({activeWorkspaceId:t,onWorkerDeleted:a,onWorkerRunStarted:o,setWorkersByWorkspaceId:i,workers:l})=>{const{language:u}=we(),f=b.useCallback(async({commandPresetId:v,name:k,role:S,roleDescription:T,startupCommand:w})=>{if(!t)return{error:"No active workspace",runId:null};const E=w.trim(),C=await tN(t,{autostart:!0,command_preset_id:v||null,description:T.trim(),name:k,role:S,startup_command:E||null,ui_language:u});return i(j=>({...j,[t]:S5(j[t]??[],C.worker)})),C.agentStart.ok&&C.agentStart.runId&&o?.({agentId:C.worker.id,agentName:C.worker.name,runId:C.agentStart.runId,terminalInputProfile:xx(v),workspaceId:t}),{error:C.agentStart.ok?null:C.agentStart.error,runId:C.agentStart.ok?C.agentStart.runId:null}},[t,u,o,i]),m=b.useCallback(async v=>{if(!t)throw new Error("No active workspace");await aN(t,v),i(k=>({...k,[t]:(k[t]??[]).filter(S=>S.id!==v)})),a?.(t,v)},[t,a,i]),g=b.useCallback(async v=>{if(!t)return{error:"No active workspace",runId:null};try{const k=await Vl(t,v);return o?.({agentId:v,agentName:v,runId:k.runId,terminalInputProfile:ib(l,v),workspaceId:t}),{error:null,runId:k.runId}}catch(k){return{error:k instanceof Error?k.message:String(k),runId:null}}},[t,o,l]),p=b.useCallback(async v=>{try{return await $l(v),{error:null}}catch(k){return{error:k instanceof Error?k.message:String(k)}}},[]),y=b.useCallback(async(v,k)=>{if(!t)return{error:"No active workspace",runId:null};try{const S=await BT(t,v,k);return o?.({agentId:v,agentName:v,runId:S.runId,terminalInputProfile:ib(l,v),workspaceId:t}),{error:null,runId:S.runId}}catch(S){return{error:S instanceof Error?S.message:String(S),runId:null}}},[t,o,l]);return{createWorker:f,deleteWorker:m,startWorker:g,stopWorkerRun:p,restartWorkerRun:y}},Km={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"]},C5=new Set(Km.mac),T5=t=>typeof t=="string"&&C5.has(t),kx=(t,a)=>Km[a].includes(t),Sx=t=>t==="mac"||t==="windows"||t==="linux"?"finder":"vscode",N5="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",Nf="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",Ex="/assets/finder-C4Jmsb0B.png",j5="/assets/ghostty-D-Js4rdm.png",A5="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",_5="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",R5="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",O5="/assets/zed-C5BQT8X3.png",D5={mac:"openWorkspace.target.finder.mac",windows:"openWorkspace.target.finder.windows",linux:"openWorkspace.target.finder.linux",other:"openWorkspace.target.finder.linux"},M5={mac:Ex,windows:Nf,linux:Nf,other:Nf},jc={vscode:{labelKey:"openWorkspace.target.vscode",iconSrc:_5},"vscode-insiders":{labelKey:"openWorkspace.target.vscodeInsiders",iconSrc:R5},cursor:{labelKey:"openWorkspace.target.cursor",iconSrc:N5},finder:{labelKey:"openWorkspace.target.finder.mac",iconSrc:Ex},terminal:{labelKey:"openWorkspace.target.terminal",iconSrc:A5},ghostty:{labelKey:"openWorkspace.target.ghostty",iconSrc:j5,iconScale:1.2},zed:{labelKey:"openWorkspace.target.zed",iconSrc:O5}},Cx=(t,a)=>t==="finder"?D5[a]:jc[t].labelKey,Tx=(t,a)=>t==="finder"?M5[a]:jc[t].iconSrc,jf=(t,a)=>{const o=kx(t,a)?t:Sx(a),i=jc[o];return{id:o,iconSrc:Tx(o,a),labelKey:Cx(o,a),...i.iconScale!==void 0?{iconScale:i.iconScale}:{}}},L5=t=>Km[t].map(a=>{const o=jc[a];return{id:a,iconSrc:Tx(a,t),labelKey:Cx(a,t),...o.iconScale!==void 0?{iconScale:o.iconScale}:{}}}),z5=()=>{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"},Nx="hive.openTarget.preferred",H5=()=>{try{return window.localStorage.getItem(Nx)}catch{return null}},B5=t=>{const a=Sx(t);if(typeof window>"u")return a;const o=H5();if(!o)return a;const i=o==="ghostie"?"ghostty":o;return T5(i)&&kx(i,t)?i:a},U5=t=>{try{window.localStorage.setItem(Nx,t)}catch{}},W5={"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"},I5=({workspace:t})=>{const{t:a}=we(),{mode:o}=G0(),i=en(),l=b.useMemo(()=>z5(),[]),u=L5(l),[f,m]=b.useState(()=>B5(l)),[g,p]=b.useState(!1),[y,v]=b.useState(!1),k=b.useRef(null),S=b.useRef(null),T=jf(f,l),w=a(T.labelKey);b.useEffect(()=>{if(!g)return;const M=U=>{U.key==="Escape"&&p(!1)},L=U=>{const q=k.current;q&&!q.contains(U.target)&&p(!1)};return document.addEventListener("keydown",M),document.addEventListener("pointerdown",L),()=>{document.removeEventListener("keydown",M),document.removeEventListener("pointerdown",L)}},[g]);const E=b.useCallback(M=>{m(M),U5(M),p(!1),S.current?.focus()},[]),C=b.useCallback(async()=>{if(!(!t||y)){v(!0);try{const M=await sN(t.id,f);if(M.ok){if(o==="mobile"){const L=jf(M.effectiveTargetId,l).labelKey;i.show({kind:"success",message:a("openWorkspace.opened",{app:a(L),workspace:t.name})})}}else{const L=jf(M.effectiveTargetId,l).labelKey;i.show({kind:"error",message:a(W5[M.errorCode],{app:a(L)})})}}catch(M){const L=M instanceof Error?M.message:String(M);i.show({kind:"error",message:L})}finally{v(!1)}}},[y,o,l,f,a,i,t]),j=!t,_=a("openWorkspace.noWorkspace"),N=t?a("openWorkspace.openIn",{app:w,workspace:t.name}):_,O=t?a("openWorkspace.openInAria",{app:w,workspace:t.name}):_;return c.jsxs("div",{ref:k,className:"open-workspace relative flex",children:[c.jsx(Qe,{label:N,children:c.jsx("span",{className:"flex",children:c.jsxs("button",{ref:S,type:"button","aria-label":O,"data-testid":"topbar-open-workspace",disabled:j||y,onClick:()=>{C()},className:"open-workspace__main",children:[c.jsx("span",{className:"open-workspace__trigger-icon","aria-hidden":!0,children:y?c.jsx(Fa,{size:13,className:"animate-spin"}):c.jsx("img",{src:T.iconSrc,alt:"",className:"open-workspace__trigger-img",style:{transform:T.iconScale?`scale(${T.iconScale})`:void 0}})}),c.jsx("span",{children:a("openWorkspace.open")})]})})}),c.jsx(Qe,{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:j,onClick:()=>p(M=>!M),className:"open-workspace__chevron",children:c.jsx(No,{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(M=>{const L=M.id===f;return c.jsxs("button",{role:"menuitemradio","aria-checked":L,type:"button",onClick:()=>E(M.id),className:"open-workspace__option","data-selected":L?"true":void 0,"data-testid":`topbar-open-workspace-option-${M.id}`,children:[c.jsx("span",{className:"open-workspace__option-icon","aria-hidden":!0,children:c.jsx("img",{src:M.iconSrc,alt:"",className:"open-workspace__option-img",style:{transform:M.iconScale?`scale(${M.iconScale})`:void 0}})}),c.jsx("span",{className:"flex-1",children:a(M.labelKey)}),c.jsx("span",{className:"open-workspace__check","aria-hidden":!0,children:L?c.jsx(Ga,{size:13}):null})]},M.id)})}):null]})},q5=b.lazy(()=>Nt(()=>import("./WorkflowsDrawer-DPWlZs4S.js"),__vite__mapDeps([5,4])).then(t=>({default:t.WorkflowsDrawer}))),P5=b.lazy(()=>Nt(()=>import("./WorkspaceMemoryDrawer-C0vny4zK.js"),__vite__mapDeps([6,3])).then(t=>({default:t.WorkspaceMemoryDrawer}))),F5=()=>{const[t,a]=b.useState(null),{activeWorkspaceId:o,selectWorkspace:i,setActiveWorkspaceId:l}=QR(),{demoMode:u,enableDemo:f,exitDemo:m}=a3(),g=u||!t?[]:t.map(({id:pe})=>pe),[p,y]=r4(g,{activeWorkspaceId:o}),[v,k]=b.useState(0),[S,T]=b.useState(!1),[w,E]=b.useState(!1),[C,j]=b.useState(!1),[_,N]=b.useState(null),[O,M]=b.useState("team"),L=A3(),U=en(),q=cx(),{wizardOpen:ae,closeWizard:ee}=k5(t),F=w5({hasExistingWorkspace:t===null?null:t.length>0,wizardOpen:ae}),X=sx().enabled;b.useEffect(()=>{X||(j(!1),M(pe=>pe==="flows"?"team":pe))},[X]);const V=b.useCallback(()=>k(pe=>pe+1),[]),[D,P]=b.useState(null),I=b.useCallback(pe=>{P(pe),U.show({kind:"error",message:pe})},[U]);VR(a,l,I);const $=GR({onWorkspaceCreated:pe=>{a(Oe=>Oe===null?[pe]:[...Oe,pe]),i(pe.id),y(Oe=>({...Oe,[pe.id]:[]}))},onError:pe=>U.show({kind:"error",message:pe})}),R=r3({demoMode:u,workspaces:t,activeWorkspaceId:o,workersByWorkspaceId:p}),B=R.effectiveActiveWorkspace?.id,re=B?R.effectiveWorkersByWorkspaceId[B]??[]:[];b.useEffect(()=>{N(pe=>pe&&re.some(Oe=>Oe.id===pe)?pe:null)},[re]);const ne=_R(R.pollWorkspaceId,n_(R.pollWorkspaceId));tR(!0);const de=jR(u?null:o??null,u?n3:void 0),fe=b.useMemo(()=>R.effectiveActiveWorkspace?xR(de.content):0,[R.effectiveActiveWorkspace,de.content]),ue=E5({activeWorkspaceId:o,onWorkerDeleted:ne.forgetOptimisticAgent,onWorkerRunStarted:ne.recordOptimisticRun,setWorkersByWorkspaceId:y,workers:re}),ie=ZR({activeWorkspaceId:o,onActiveDeleted:()=>{E(!1),T(!1),j(!1)},selectWorkspace:i,setWorkersByWorkspaceId:y,setWorkspaces:a,workspaces:t});qR({bootstrapError:D,onSelectWorkspace:i,onTriggerAddDialog:V,workspaces:R.effectiveWorkspaces}),dR({onAddWorkspace:V,onTryDemo:f,ready:u||t!==null||D!==null});const le=$R(),ce=D!==null&&!u&&t===null,me=wt(),Te=b.useSyncExternalStore(OR,DR),Ne=me?c.jsx(O3,{status:Te}):null,Se=B?ne.optimisticRunsByWorkspaceId[B]??[]:[],xt=!ce&&!u&&B!==void 0&&(ne.terminalRuns.length>0||Se.length>0)?c.jsx(h5,{optimisticRuns:Se,terminalRuns:ne.terminalRuns,workspaceId:B},`terminal-${B}`):null,Wt=ce?c.jsx(aR,{onTryDemo:f}):c.jsx(e3,{activeId:B,activeWorkspace:R.effectiveActiveWorkspace,activeWorkerId:_,bootstrapError:D,demoMode:u,workspacesLoading:!u&&t===null,onActiveWorkerChange:N,onDeleteWorkspace:ie,onExitDemo:m,onRequestAddWorkspace:V,onShellRunClosed:ne.forgetOptimisticRun,onShellRunStarted:(pe,Oe)=>ne.recordOptimisticRun({agentId:Oe.agent_id,agentName:Oe.agent_name,runId:Oe.run_id,status:Oe.status,terminalInputProfile:Oe.terminal_input_profile??"default",workspaceId:pe}),onTryDemo:f,orchestratorAutostartErrors:$.orchestratorAutostartErrors,orchestratorAutostartRunIds:$.orchestratorAutostartRunIds,recordOrchestratorResult:$.recordOrchestratorResult,terminalRuns:ne.terminalRuns,workerActions:ue,workers:re,showInlineActionCenter:me}),pn=c.jsx(Q2,{addDialogTrigger:v,wizardOpen:ae,whatsNewOpen:F.open,whatsNewEntries:F.entries,onCloseWhatsNew:F.close,onAddWorkspace:V,onCloseTaskGraph:()=>T(!1),onCloseWizard:ee,onCreateWorkspace:$.createNewWorkspace,onTryDemo:f,taskGraphOpen:S,tasksFile:de,workspacePath:R.effectiveActiveWorkspace?.path??null,workers:re,onSelectOwner:le}),hn=C&&!u&&X?c.jsx(b.Suspense,{fallback:null,children:c.jsx(q5,{open:!0,onClose:()=>j(!1),workspaceId:o??null})}):null,Tn=w&&!u?c.jsx(b.Suspense,{fallback:null,children:c.jsx(P5,{open:!0,onClose:()=>E(!1),workspaceId:o??null})}):null,tn=c.jsx(vR,{activeWorkspaceId:R.effectiveActiveWorkspaceId,collapsed:L.collapsed,createDisabledReason:D??void 0,onCreateClick:V,onDeleteWorkspace:ie,onSelectWorkspace:i,onToggleCollapse:L.toggleCollapsed,workersByWorkspaceId:R.effectiveWorkersByWorkspaceId,workspaces:R.effectiveWorkspaces}),ke=c.jsxs(c.Fragment,{children:[c.jsx(I5,{workspace:R.effectiveActiveWorkspace}),ce||u||!B?null:c.jsx(TA,{workspaceId:B,onOpenWorker:N},B)]});return me?c.jsxs(c.Fragment,{children:[c.jsx(F3,{workspaceSwitcher:ce?void 0:c.jsx(X3,{activeWorkspaceId:R.effectiveActiveWorkspaceId,workspaces:R.effectiveWorkspaces,workersByWorkspaceId:R.effectiveWorkersByWorkspaceId,createDisabledReason:D??void 0,onCreateClick:V,onDeleteWorkspace:ie,onSelectWorkspace:i}),topbarActions:ce?void 0:c.jsx(c.Fragment,{children:c.jsx(lx,{})}),openTaskCount:fe,workingCount:re.filter(pe=>pe.status==="working").length,banner:Ne,terminalPanels:xt,fullBleed:ce?Wt:void 0,team:ce?null:Wt,tasks:ce?null:c.jsx(V3,{tasksFile:de,workspacePath:R.effectiveActiveWorkspace?.path??null,workers:re,onSelectOwner:le,onAddWorkspace:V,demoMode:u}),settings:ce||!u?void 0:c.jsx(z3,{demoMode:u,onTryDemo:f,onExitDemo:m}),activeSection:O,onSectionChange:M,overlays:pn}),c.jsx(Zy,{versionInfo:q}),c.jsx(Gy,{terminalRuns:ne.terminalRuns}),c.jsx(Xy,{})]}):c.jsxs(c.Fragment,{children:[c.jsxs(_3,{hideTopbarActions:!R.effectiveActiveWorkspace,memoryOpen:w,onToggleMemory:u?void 0:()=>E(pe=>!pe),onToggleTaskGraph:()=>T(pe=>!pe),openTaskCount:fe,topbarActions:ke,taskGraphOpen:S,onToggleWorkflows:u||!X?void 0:()=>j(pe=>!pe),workflowsOpen:C,sidebarResize:L,sidebar:tn,versionInfo:q,children:[Wt,xt,pn,Tn,hn]}),c.jsx(Zy,{versionInfo:q}),c.jsx(Gy,{terminalRuns:ne.terminalRuns}),c.jsx(Xy,{}),c.jsx(eR,{})]})},K5={success:qb,warning:Fs,error:jS},Af={success:"var(--status-green)",warning:"var(--status-orange)",error:"var(--status-red)"},lb=({toast:t,api:a})=>{const{t:o}=we(),i=K5[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, ${Af[t.kind]} 35%, var(--border))`},children:[c.jsx("span",{className:"mt-0.5 shrink-0",style:{color:Af[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(Ka,{size:14,"aria-hidden":!0})}),l>0?c.jsx("span",{className:"toast-progress-bar",style:{background:Af[t.kind],animationDuration:`${l}ms`},"aria-hidden":!0}):null]})},Y5=()=>{const t=wA(),a=en(),o=wt();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(lb,{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(lb,{toast:u,api:a},u.id))})]})},V5=({children:t})=>c.jsx(Nw,{delayDuration:250,skipDelayDuration:150,children:c.jsx(VE,{children:c.jsx(bA,{children:c.jsx(LA,{children:c.jsx(x3,{children:c.jsx(b3,{children:c.jsxs(h3,{children:[t,c.jsx(Y5,{})]})})})})})})}),$5=()=>c.jsx(_N,{children:c.jsx(V5,{children:c.jsx(F5,{})})}),cb="\0gw:",xr={Unauthorized:4401,Forbidden:4403,DaemonOffline:4404,Revoked:4410,InternalError:4500},jx="hb:ping",Ax="hb:pong",G5=t=>t===xr.Unauthorized||t===xr.Revoked;function X5(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}function om(t){if(typeof t!="boolean")throw new TypeError(`boolean expected, not ${t}`)}function bo(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=X5(t),l=t?.length,u=a!==void 0;if(!i||u&&l!==a){const f=o&&`"${o}" `,m=u?` of length ${a}`:"",g=i?`length=${l}`:`type=${typeof t}`,p=f+"expected Uint8Array"+m+", got "+g;throw i?new RangeError(p):new TypeError(p)}return t}function ub(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 Z5(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&&!$s(t))throw new Error("invalid output, must be aligned")}function oa(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function qa(...t){for(let a=0;a<t.length;a++)t[a].fill(0)}function Q5(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const kr=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,_x=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255,St=kr?t=>t:t=>_x(t)>>>0,J5=t=>{for(let a=0;a<t.length;a++)t[a]=_x(t[a]);return t},Wa=kr?t=>t:J5;function eO(t,a){if(a==null||typeof a!="object")throw new Error("options must be defined");return Object.assign(t,a)}function tO(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 nO(t,a,o){const i=a,l=(()=>[]),u=(m,g)=>i(g,...l(m)).update(m).digest(),f=i(new Uint8Array(t),...l(new Uint8Array(0)));return u.outputLen=f.outputLen,u.blockLen=f.blockLen,u.create=(m,...g)=>i(m,...g),u}const aO=(t,a)=>{function o(i,...l){if(Et(i,void 0,"key"),t.nonceLength!==void 0){const y=l[0];Et(y,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),m=(y,v)=>{if(v!==void 0){if(y!==2)throw new Error("cipher output not supported");Et(v,void 0,"output")}};let g=!1;return{encrypt(y,v){if(g)throw new Error("cannot encrypt() twice with same key + nonce");return g=!0,Et(y),m(f.encrypt.length,v),f.encrypt(y,v)},decrypt(y,v){if(Et(y),u&&y.length<u)throw new Error('"ciphertext" expected length bigger than tagLength='+u);return m(f.decrypt.length,v),f.decrypt(y,v)}}}return Object.assign(o,t),o};function sm(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&&!$s(a))throw new Error("invalid output, must be aligned");return a}function rO(t,a,o){bo(t),bo(a),om(o);const i=new Uint8Array(16),l=Q5(i);return l.setBigUint64(0,BigInt(a),o),l.setBigUint64(8,BigInt(t),o),i}function $s(t){return t.byteOffset%4===0}function ac(t){return Uint8Array.from(Et(t))}function Rx(t=32){bo(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 Ox=t=>Uint8Array.from(t.split(""),a=>a.charCodeAt(0)),oO=Wa(oa(Ox("expand 16-byte k"))),sO=Wa(oa(Ox("expand 32-byte k")));function ve(t,a){return t<<a|t>>>32-a}const Ms=64,iO=16,im=2**32-1,db=Uint32Array.of();function lO(t,a,o,i,l,u,f,m){const g=l.length,p=new Uint8Array(Ms),y=oa(p),v=kr&&$s(l)&&$s(u),k=v?oa(l):db,S=v?oa(u):db;if(!kr){for(let T=0;T<g;f++){if(t(a,o,i,y,f,m),Wa(y),f>=im)throw new Error("arx: counter overflow");const w=Math.min(Ms,g-T);for(let E=0,C;E<w;E++)C=T+E,u[C]=l[C]^p[E];T+=w}return}for(let T=0;T<g;f++){if(t(a,o,i,y,f,m),f>=im)throw new Error("arx: counter overflow");const w=Math.min(Ms,g-T);if(v&&w===Ms){const E=T/4;if(T%4!==0)throw new Error("arx: invalid block position");for(let C=0,j;C<iO;C++)j=E+C,S[j]=k[j]^y[C];T+=Ms;continue}for(let E=0,C;E<w;E++)C=T+E,u[C]=l[C]^p[E];T+=w}}function cO(t,a){const{allowShortKeys:o,extendNonceFn:i,counterLength:l,counterRight:u,rounds:f}=eO({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},a);if(typeof t!="function")throw new Error("core must be a function");return bo(l),bo(f),om(u),om(o),(m,g,p,y,v=0)=>{Et(m,void 0,"key"),Et(g,void 0,"nonce"),Et(p,void 0,"data");const k=p.length;if(y=sm(k,y,!1),bo(v),v<0||v>=im)throw new Error("arx: counter overflow");const S=[];let T=m.length,w,E;if(T===32)S.push(w=ac(m)),E=sO;else if(T===16&&o)w=new Uint8Array(32),w.set(m),w.set(m,16),E=oO,S.push(w);else throw Et(m,32,"arx key"),new Error("invalid key size");(!kr||!$s(g))&&S.push(g=ac(g));let C=oa(w);if(i){if(g.length!==24)throw new Error("arx: extended nonce must be 24 bytes");const N=g.subarray(0,16);if(kr)i(E,C,oa(N),C);else{const O=Wa(Uint32Array.from(E));i(O,C,oa(N),C),qa(O),Wa(C)}g=g.subarray(16)}else kr||Wa(C);const j=16-l;if(j!==g.length)throw new Error(`arx: nonce must be ${j} or 16 bytes`);if(j!==12){const N=new Uint8Array(12);N.set(g,u?0:12-g.length),g=N,S.push(g)}const _=Wa(oa(g));try{return lO(t,E,C,_,p,y,v,f),y}finally{qa(...S)}}}function yt(t,a){return t[a++]&255|(t[a++]&255)<<8}class uO{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=ac(Et(a,32,"key"));const o=yt(a,0),i=yt(a,2),l=yt(a,4),u=yt(a,6),f=yt(a,8),m=yt(a,10),g=yt(a,12),p=yt(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|m<<2)&8191,this.r[7]=(m>>>11|g<<5)&8065,this.r[8]=(g>>>8|p<<8)&8191,this.r[9]=p>>>5&127;for(let y=0;y<8;y++)this.pad[y]=yt(a,16+2*y)}process(a,o,i=!1){const l=i?0:2048,{h:u,r:f}=this,m=f[0],g=f[1],p=f[2],y=f[3],v=f[4],k=f[5],S=f[6],T=f[7],w=f[8],E=f[9],C=yt(a,o+0),j=yt(a,o+2),_=yt(a,o+4),N=yt(a,o+6),O=yt(a,o+8),M=yt(a,o+10),L=yt(a,o+12),U=yt(a,o+14);let q=u[0]+(C&8191),ae=u[1]+((C>>>13|j<<3)&8191),ee=u[2]+((j>>>10|_<<6)&8191),F=u[3]+((_>>>7|N<<9)&8191),J=u[4]+((N>>>4|O<<12)&8191),X=u[5]+(O>>>1&8191),V=u[6]+((O>>>14|M<<2)&8191),D=u[7]+((M>>>11|L<<5)&8191),P=u[8]+((L>>>8|U<<8)&8191),I=u[9]+(U>>>5|l),$=0,Z=$+q*m+ae*(5*E)+ee*(5*w)+F*(5*T)+J*(5*S);$=Z>>>13,Z&=8191,Z+=X*(5*k)+V*(5*v)+D*(5*y)+P*(5*p)+I*(5*g),$+=Z>>>13,Z&=8191;let R=$+q*g+ae*m+ee*(5*E)+F*(5*w)+J*(5*T);$=R>>>13,R&=8191,R+=X*(5*S)+V*(5*k)+D*(5*v)+P*(5*y)+I*(5*p),$+=R>>>13,R&=8191;let B=$+q*p+ae*g+ee*m+F*(5*E)+J*(5*w);$=B>>>13,B&=8191,B+=X*(5*T)+V*(5*S)+D*(5*k)+P*(5*v)+I*(5*y),$+=B>>>13,B&=8191;let re=$+q*y+ae*p+ee*g+F*m+J*(5*E);$=re>>>13,re&=8191,re+=X*(5*w)+V*(5*T)+D*(5*S)+P*(5*k)+I*(5*v),$+=re>>>13,re&=8191;let ne=$+q*v+ae*y+ee*p+F*g+J*m;$=ne>>>13,ne&=8191,ne+=X*(5*E)+V*(5*w)+D*(5*T)+P*(5*S)+I*(5*k),$+=ne>>>13,ne&=8191;let de=$+q*k+ae*v+ee*y+F*p+J*g;$=de>>>13,de&=8191,de+=X*m+V*(5*E)+D*(5*w)+P*(5*T)+I*(5*S),$+=de>>>13,de&=8191;let fe=$+q*S+ae*k+ee*v+F*y+J*p;$=fe>>>13,fe&=8191,fe+=X*g+V*m+D*(5*E)+P*(5*w)+I*(5*T),$+=fe>>>13,fe&=8191;let ue=$+q*T+ae*S+ee*k+F*v+J*y;$=ue>>>13,ue&=8191,ue+=X*p+V*g+D*m+P*(5*E)+I*(5*w),$+=ue>>>13,ue&=8191;let ie=$+q*w+ae*T+ee*S+F*k+J*v;$=ie>>>13,ie&=8191,ie+=X*y+V*p+D*g+P*m+I*(5*E),$+=ie>>>13,ie&=8191;let le=$+q*E+ae*w+ee*T+F*S+J*k;$=le>>>13,le&=8191,le+=X*v+V*y+D*p+P*g+I*m,$+=le>>>13,le&=8191,$=($<<2)+$|0,$=$+Z|0,Z=$&8191,$=$>>>13,R+=$,u[0]=Z,u[1]=R,u[2]=B,u[3]=re,u[4]=ne,u[5]=de,u[6]=fe,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 m=2;m<10;m++)a[m]+=l,l=a[m]>>>13,a[m]&=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 m=1;m<10;m++)i[m]=a[m]+l,l=i[m]>>>13,i[m]&=8191;i[9]-=8192;let u=(l^1)-1;for(let m=0;m<10;m++)i[m]&=u;u=~u;for(let m=0;m<10;m++)a[m]=a[m]&u|i[m];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 m=1;m<8;m++)f=(a[m]+o[m]|0)+(f>>>16)|0,a[m]=f&65535;qa(i)}update(a){ub(this),Et(a),a=ac(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,qa(this.h,this.r,this.buffer,this.pad)}digestInto(a){ub(this),Z5(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 dO=nO(32,t=>new uO(t));function fO(t,a,o,i,l,u=20){let f=t[0],m=t[1],g=t[2],p=t[3],y=a[0],v=a[1],k=a[2],S=a[3],T=a[4],w=a[5],E=a[6],C=a[7],j=l,_=o[0],N=o[1],O=o[2],M=f,L=m,U=g,q=p,ae=y,ee=v,F=k,J=S,X=T,V=w,D=E,P=C,I=j,$=_,Z=N,R=O;for(let re=0;re<u;re+=2)M=M+ae|0,I=ve(I^M,16),X=X+I|0,ae=ve(ae^X,12),M=M+ae|0,I=ve(I^M,8),X=X+I|0,ae=ve(ae^X,7),L=L+ee|0,$=ve($^L,16),V=V+$|0,ee=ve(ee^V,12),L=L+ee|0,$=ve($^L,8),V=V+$|0,ee=ve(ee^V,7),U=U+F|0,Z=ve(Z^U,16),D=D+Z|0,F=ve(F^D,12),U=U+F|0,Z=ve(Z^U,8),D=D+Z|0,F=ve(F^D,7),q=q+J|0,R=ve(R^q,16),P=P+R|0,J=ve(J^P,12),q=q+J|0,R=ve(R^q,8),P=P+R|0,J=ve(J^P,7),M=M+ee|0,R=ve(R^M,16),D=D+R|0,ee=ve(ee^D,12),M=M+ee|0,R=ve(R^M,8),D=D+R|0,ee=ve(ee^D,7),L=L+F|0,I=ve(I^L,16),P=P+I|0,F=ve(F^P,12),L=L+F|0,I=ve(I^L,8),P=P+I|0,F=ve(F^P,7),U=U+J|0,$=ve($^U,16),X=X+$|0,J=ve(J^X,12),U=U+J|0,$=ve($^U,8),X=X+$|0,J=ve(J^X,7),q=q+ae|0,Z=ve(Z^q,16),V=V+Z|0,ae=ve(ae^V,12),q=q+ae|0,Z=ve(Z^q,8),V=V+Z|0,ae=ve(ae^V,7);let B=0;i[B++]=f+M|0,i[B++]=m+L|0,i[B++]=g+U|0,i[B++]=p+q|0,i[B++]=y+ae|0,i[B++]=v+ee|0,i[B++]=k+F|0,i[B++]=S+J|0,i[B++]=T+X|0,i[B++]=w+V|0,i[B++]=E+D|0,i[B++]=C+P|0,i[B++]=j+I|0,i[B++]=_+$|0,i[B++]=N+Z|0,i[B++]=O+R|0}function mO(t,a,o,i){let l=St(t[0]),u=St(t[1]),f=St(t[2]),m=St(t[3]),g=St(a[0]),p=St(a[1]),y=St(a[2]),v=St(a[3]),k=St(a[4]),S=St(a[5]),T=St(a[6]),w=St(a[7]),E=St(o[0]),C=St(o[1]),j=St(o[2]),_=St(o[3]);for(let O=0;O<20;O+=2)l=l+g|0,E=ve(E^l,16),k=k+E|0,g=ve(g^k,12),l=l+g|0,E=ve(E^l,8),k=k+E|0,g=ve(g^k,7),u=u+p|0,C=ve(C^u,16),S=S+C|0,p=ve(p^S,12),u=u+p|0,C=ve(C^u,8),S=S+C|0,p=ve(p^S,7),f=f+y|0,j=ve(j^f,16),T=T+j|0,y=ve(y^T,12),f=f+y|0,j=ve(j^f,8),T=T+j|0,y=ve(y^T,7),m=m+v|0,_=ve(_^m,16),w=w+_|0,v=ve(v^w,12),m=m+v|0,_=ve(_^m,8),w=w+_|0,v=ve(v^w,7),l=l+p|0,_=ve(_^l,16),T=T+_|0,p=ve(p^T,12),l=l+p|0,_=ve(_^l,8),T=T+_|0,p=ve(p^T,7),u=u+y|0,E=ve(E^u,16),w=w+E|0,y=ve(y^w,12),u=u+y|0,E=ve(E^u,8),w=w+E|0,y=ve(y^w,7),f=f+v|0,C=ve(C^f,16),k=k+C|0,v=ve(v^k,12),f=f+v|0,C=ve(C^f,8),k=k+C|0,v=ve(v^k,7),m=m+g|0,j=ve(j^m,16),S=S+j|0,g=ve(g^S,12),m=m+g|0,j=ve(j^m,8),S=S+j|0,g=ve(g^S,7);let N=0;i[N++]=l,i[N++]=u,i[N++]=f,i[N++]=m,i[N++]=E,i[N++]=C,i[N++]=j,i[N++]=_,Wa(i)}const pO=cO(fO,{counterRight:!1,counterLength:8,extendNonceFn:mO,allowShortKeys:!1}),hO=new Uint8Array(16),fb=(t,a)=>{t.update(a);const o=a.length%16;o&&t.update(hO.subarray(o))},gO=new Uint8Array(32);function mb(t,a,o,i,l){l!==void 0&&Et(l,void 0,"AAD");const u=t(a,o,gO),f=rO(i.length,l?l.length:0,!0),m=dO.create(u);l&&fb(m,l),fb(m,i),m.update(f);const g=m.digest();return qa(u,f),g}const vO=t=>(a,o,i)=>({encrypt(u,f){const m=u.length;f=sm(m+16,f,!1),f.set(u);const g=f.subarray(0,-16);t(a,o,g,g,1);const p=mb(t,a,o,g,i);return f.set(p,m),qa(p),f},decrypt(u,f){f=sm(u.length-16,f,!1);const m=u.subarray(0,-16),g=u.subarray(-16),p=mb(t,a,o,m,i);if(!tO(g,p))throw qa(p),new Error("invalid tag");return f.set(u.subarray(0,-16)),t(a,o,f,f,1),qa(p),f}}),Dx=aO({blockSize:64,nonceLength:24,tagLength:16},vO(pO));function yO(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}function Co(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 la(t,a,o=""){const i=yO(t),l=t?.length,u=a!==void 0;if(!i||u&&l!==a){const f=o&&`"${o}" `,m=u?` of length ${a}`:"",g=i?`length=${l}`:`type=${typeof t}`,p=f+"expected Uint8Array"+m+", got "+g;throw i?new RangeError(p):new TypeError(p)}return t}function Ym(t){if(typeof t!="function"||typeof t.create!="function")throw new TypeError("Hash must wrapped by utils.createHasher");if(Co(t.outputLen),Co(t.blockLen),t.outputLen<1)throw new Error('"outputLen" must be >= 1');if(t.blockLen<1)throw new Error('"blockLen" must be >= 1')}function rc(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 Mx(t,a){la(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 Gs(...t){for(let a=0;a<t.length;a++)t[a].fill(0)}function _f(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Rn(t,a){return t<<32-a|t>>>a}const Lx=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",bO=Array.from({length:256},(t,a)=>a.toString(16).padStart(2,"0"));function Vm(t){if(la(t),Lx)return t.toHex();let a="";for(let o=0;o<t.length;o++)a+=bO[t[o]];return a}const ra={_0:48,_9:57,A:65,F:70,a:97,f:102};function pb(t){if(t>=ra._0&&t<=ra._9)return t-ra._0;if(t>=ra.A&&t<=ra.F)return t-(ra.A-10);if(t>=ra.a&&t<=ra.f)return t-(ra.a-10)}function $m(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);if(Lx)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=pb(t.charCodeAt(u)),m=pb(t.charCodeAt(u+1));if(f===void 0||m===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+m}return i}function wO(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 xO(t=32){Co(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 kO=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});function SO(t,a,o){return t&a^~t&o}function EO(t,a,o){return t&a^t&o^a&o}class CO{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=_f(this.buffer)}update(a){rc(this),la(a);const{view:o,buffer:i,blockLen:l}=this,u=a.length;for(let f=0;f<u;){const m=Math.min(l-this.pos,u-f);if(m===l){const g=_f(a);for(;l<=u-f;f+=l)this.process(g,f);continue}i.set(a.subarray(f,f+m),this.pos),this.pos+=m,f+=m,this.pos===l&&(this.process(o,0),this.pos=0)}return this.length+=a.length,this.roundClean(),this}digestInto(a){rc(this),Mx(a,this),this.finished=!0;const{buffer:o,view:i,blockLen:l,isLE:u}=this;let{pos:f}=this;o[f++]=128,Gs(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 m=_f(a),g=this.outputLen;if(g%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const p=g/4,y=this.get();if(p>y.length)throw new Error("_sha2: outputLen bigger than state");for(let v=0;v<p;v++)m.setUint32(4*v,y[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:m}=this;return a.destroyed=f,a.finished=u,a.length=l,a.pos=m,l%o&&a.buffer.set(i),a}clone(){return this._cloneInto()}}const La=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),TO=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]),za=new Uint32Array(64);class NO extends CO{constructor(a){super(64,a,8,!1)}get(){const{A:a,B:o,C:i,D:l,E:u,F:f,G:m,H:g}=this;return[a,o,i,l,u,f,m,g]}set(a,o,i,l,u,f,m,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=m|0,this.H=g|0}process(a,o){for(let v=0;v<16;v++,o+=4)za[v]=a.getUint32(o,!1);for(let v=16;v<64;v++){const k=za[v-15],S=za[v-2],T=Rn(k,7)^Rn(k,18)^k>>>3,w=Rn(S,17)^Rn(S,19)^S>>>10;za[v]=w+za[v-7]+T+za[v-16]|0}let{A:i,B:l,C:u,D:f,E:m,F:g,G:p,H:y}=this;for(let v=0;v<64;v++){const k=Rn(m,6)^Rn(m,11)^Rn(m,25),S=y+k+SO(m,g,p)+TO[v]+za[v]|0,w=(Rn(i,2)^Rn(i,13)^Rn(i,22))+EO(i,l,u)|0;y=p,p=g,g=m,m=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,m=m+this.E|0,g=g+this.F|0,p=p+this.G|0,y=y+this.H|0,this.set(i,l,u,f,m,g,p,y)}roundClean(){Gs(za)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Gs(this.buffer)}}class jO extends NO{A=La[0]|0;B=La[1]|0;C=La[2]|0;D=La[3]|0;E=La[4]|0;F=La[5]|0;G=La[6]|0;H=La[7]|0;constructor(){super(32)}}const wo=wO(()=>new jO,kO(1));const Pa=(t,a,o)=>la(t,a,o),zx=Co,Hx=Vm,AO=t=>$m(t),_O=t=>xO(t),oc=BigInt(0),lm=BigInt(1);function Bx(t,a=""){if(typeof t!="boolean"){const o=a&&`"${a}" `;throw new TypeError(o+"expected boolean, got type="+typeof t)}return t}function RO(t){if(typeof t=="bigint"){if(!ql(t))throw new RangeError("positive bigint expected, got "+t)}else zx(t);return t}function hb(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 Ux(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);return t===""?oc:BigInt("0x"+t)}function OO(t){return Ux(Vm(t))}function Xs(t){return Ux(Vm(Zs(la(t)).reverse()))}function Wx(t,a){if(Co(a),a===0)throw new RangeError("zero length");t=RO(t);const o=t.toString(16);if(o.length>a*2)throw new RangeError("number too large");return $m(o.padStart(a*2,"0"))}function Ix(t,a){return Wx(t,a).reverse()}function DO(t,a){if(t=Pa(t),a=Pa(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 Zs(t){return Uint8Array.from(Pa(t))}const ql=t=>typeof t=="bigint"&&oc<=t;function MO(t,a,o){return ql(t)&&ql(a)&&ql(o)&&a<=t&&t<o}function sc(t,a,o,i){if(!MO(a,o,i))throw new RangeError("expected valid "+t+": "+o+" <= n < "+i+", got "+a)}function LO(t){if(t<oc)throw new Error("expected non-negative bigint, got "+t);let a;for(a=0;t>oc;t>>=lm,a+=1);return a}const zO=t=>(lm<<BigInt(t))-lm;function Gm(t,a={},o={}){if(Object.prototype.toString.call(t)!=="[object Object]")throw new TypeError("expected valid options object");function i(u,f,m){if(!m&&f!=="function"&&!Object.hasOwn(t,u))throw new TypeError(`param "${u}" is invalid: expected own property`);const g=t[u];if(m&&g===void 0)return;const p=typeof g;if(p!==f||g===null)throw new TypeError(`param "${u}" is invalid: expected ${f}, got ${p}`)}const l=(u,f)=>Object.entries(u).forEach(([m,g])=>i(m,g,f));l(a,!1),l(o,!0)}const gb=()=>{throw new Error("not implemented")};const Ct=BigInt(0),bt=BigInt(1),br=BigInt(2),qx=BigInt(3),Px=BigInt(4),Fx=BigInt(5),HO=BigInt(7),Kx=BigInt(8),BO=BigInt(9),Yx=BigInt(16);function at(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 bn(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 vb(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=at(t,a),i=a,l=Ct,u=bt;for(;o!==Ct;){const m=i/o,g=i-o*m,p=l-u*m;i=o,o=g,l=u,u=p}if(i!==bt)throw new Error("invert: does not exist");return at(l,a)}function Xm(t,a,o){const i=t;if(!i.eql(i.sqr(a),o))throw new Error("Cannot find square root")}function Vx(t,a){const o=t,i=(o.ORDER+bt)/Px,l=o.pow(a,i);return Xm(o,l,a),l}function UO(t,a){const o=t,i=(o.ORDER-Fx)/Kx,l=o.mul(a,br),u=o.pow(l,i),f=o.mul(a,u),m=o.mul(o.mul(f,br),u),g=o.mul(f,o.sub(m,o.ONE));return Xm(o,g,a),g}function WO(t){const a=Zm(t),o=$x(t),i=o(a,a.neg(a.ONE)),l=o(a,i),u=o(a,a.neg(i)),f=(t+HO)/Yx;return((m,g)=>{const p=m;let y=p.pow(g,f),v=p.mul(y,i);const k=p.mul(y,l),S=p.mul(y,u),T=p.eql(p.sqr(v),g),w=p.eql(p.sqr(k),g);y=p.cmov(y,v,T),v=p.cmov(S,k,w);const E=p.eql(p.sqr(v),g),C=p.cmov(y,v,E);return Xm(p,C,g),C})}function $x(t){if(t<qx)throw new Error("sqrt is not defined for small field");let a=t-bt,o=0;for(;a%br===Ct;)a/=br,o++;let i=br;const l=Zm(t);for(;yb(l,i)===1;)if(i++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(o===1)return Vx;let u=l.pow(i,a);const f=(a+bt)/br;return function(g,p){const y=g;if(y.is0(p))return p;if(yb(y,p)!==1)throw new Error("Cannot find square root");let v=o,k=y.mul(y.ONE,u),S=y.pow(p,a),T=y.pow(p,f);for(;!y.eql(S,y.ONE);){if(y.is0(S))return y.ZERO;let w=1,E=y.sqr(S);for(;!y.eql(E,y.ONE);)if(w++,E=y.sqr(E),w===v)throw new Error("Cannot find square root");const C=bt<<BigInt(v-w-1),j=y.pow(k,C);v=w,k=y.sqr(j),S=y.mul(S,k),T=y.mul(T,j)}return T}}function IO(t){return t%Px===qx?Vx:t%Kx===Fx?UO:t%Yx===BO?WO(t):$x(t)}const vr=(t,a)=>(at(t,a)&bt)===bt,qO=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function PO(t){const a={ORDER:"bigint",BYTES:"number",BITS:"number"},o=qO.reduce((i,l)=>(i[l]="function",i),a);if(Gm(t,o),hb(t.BYTES,"BYTES"),hb(t.BITS,"BITS"),t.BYTES<1||t.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(t.ORDER<=bt)throw new Error("invalid field: expected ORDER > 1, got "+t.ORDER);return t}function FO(t,a,o){const i=t;if(o<Ct)throw new Error("invalid exponent, negatives unsupported");if(o===Ct)return i.ONE;if(o===bt)return a;let l=i.ONE,u=a;for(;o>Ct;)o&bt&&(l=i.mul(l,u)),u=i.sqr(u),o>>=bt;return l}function Gx(t,a,o=!1){const i=t,l=new Array(a.length).fill(o?i.ZERO:void 0),u=a.reduce((m,g,p)=>i.is0(g)?m:(l[p]=m,i.mul(m,g)),i.ONE),f=i.inv(u);return a.reduceRight((m,g,p)=>i.is0(g)?m:(l[p]=i.mul(m,l[p]),i.mul(m,g)),f),l}function yb(t,a){const o=t,i=(o.ORDER-bt)/br,l=o.pow(a,i),u=o.eql(l,o.ONE),f=o.eql(l,o.ZERO),m=o.eql(l,o.neg(o.ONE));if(!u&&!f&&!m)throw new Error("invalid Legendre symbol result");return u?1:f?0:-1}function KO(t,a){if(a!==void 0&&zx(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=LO(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 bb=new WeakMap;class Xx{ORDER;BITS;BYTES;isLE;ZERO=Ct;ONE=bt;_lengths;_mod;constructor(a,o={}){if(a<=bt)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}=KO(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 at(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&bt)===bt}neg(a){return at(-a,this.ORDER)}eql(a,o){return a===o}sqr(a){return at(a*a,this.ORDER)}add(a,o){return at(a+o,this.ORDER)}sub(a,o){return at(a-o,this.ORDER)}mul(a,o){return at(a*o,this.ORDER)}pow(a,o){return FO(this,a,o)}div(a,o){return at(a*vb(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 vb(a,this.ORDER)}sqrt(a){let o=bb.get(this);return o||bb.set(this,o=IO(this.ORDER)),o(this,a)}toBytes(a){return this.isLE?Ix(a,this.BYTES):Wx(a,this.BYTES)}fromBytes(a,o=!1){Pa(a);const{_lengths:i,BYTES:l,isLE:u,ORDER:f,_mod:m}=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 p=new Uint8Array(l);p.set(a,u?0:p.length-a.length),a=p}if(a.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+a.length);let g=u?Xs(a):OO(a);if(m&&(g=at(g,f)),!o&&!this.isValid(g))throw new Error("invalid field element: outside of range 0..ORDER");return g}invertBatch(a){return Gx(this,a)}cmov(a,o,i){return Bx(i,"condition"),i?o:a}}Object.freeze(Xx.prototype);function Zm(t,a={}){return new Xx(t,a)}const ic=BigInt(0),cm=BigInt(1);function wb(t,a){const o=a.negate();return t?o:a}function Rf(t,a){const o=Gx(t.Fp,a.map(i=>i.Z));return a.map((i,l)=>t.fromAffine(i.toAffine(o[l])))}function Zx(t,a){if(!Number.isSafeInteger(t)||t<=0||t>a)throw new Error("invalid window size, expected [1.."+a+"], got W="+t)}function Of(t,a){Zx(t,a);const o=Math.ceil(a/t)+1,i=2**(t-1),l=2**t,u=zO(t),f=BigInt(t);return{windows:o,windowSize:i,mask:u,maxNumber:l,shiftBy:f}}function xb(t,a,o){const{windowSize:i,mask:l,maxNumber:u,shiftBy:f}=o;let m=Number(t&l),g=t>>f;m>i&&(m-=u,g+=cm);const p=a*i,y=p+Math.abs(m)-1,v=m===0,k=m<0,S=a%2!==0;return{nextN:g,offset:y,isZero:v,isNeg:k,isNegF:S,offsetF:p}}const Df=new WeakMap,Qx=new WeakMap;function Mf(t){return Qx.get(t)||1}function kb(t){if(t!==ic)throw new Error("invalid wNAF")}class YO{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>ic;)o&cm&&(i=i.add(l)),l=l.double(),o>>=cm;return i}precomputeWindow(a,o){const{windows:i,windowSize:l}=Of(o,this.bits),u=[];let f=a,m=f;for(let g=0;g<i;g++){m=f,u.push(m);for(let p=1;p<l;p++)m=m.add(f),u.push(m);f=m.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=Of(a,this.bits);for(let m=0;m<f.windows;m++){const{nextN:g,offset:p,isZero:y,isNeg:v,isNegF:k,offsetF:S}=xb(i,m,f);i=g,y?u=u.add(wb(k,o[S])):l=l.add(wb(v,o[p]))}return kb(i),{p:l,f:u}}wNAFUnsafe(a,o,i,l=this.ZERO){const u=Of(a,this.bits);for(let f=0;f<u.windows&&i!==ic;f++){const{nextN:m,offset:g,isZero:p,isNeg:y}=xb(i,f,u);if(i=m,!p){const v=o[g];l=l.add(y?v.negate():v)}}return kb(i),l}getPrecomputes(a,o,i){let l=Df.get(o);return l||(l=this.precomputeWindow(o,a),a!==1&&(typeof i=="function"&&(l=i(l)),Df.set(o,l))),l}cached(a,o,i){const l=Mf(a);return this.wNAF(l,this.getPrecomputes(l,a,i),o)}unsafe(a,o,i,l){const u=Mf(a);return u===1?this._unsafeLadder(a,o,l):this.wNAFUnsafe(u,this.getPrecomputes(u,a,i),o,l)}createCache(a,o){Zx(o,this.bits),Qx.set(a,o),Df.delete(a)}hasCache(a){return Mf(a)!==1}}function Sb(t,a,o){if(a){if(a.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return PO(a),a}else return Zm(t,{isLE:o})}function VO(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 p=a[g];if(!(typeof p=="bigint"&&p>ic))throw new Error(`CURVE.${g} must be positive bigint`)}const l=Sb(a.p,o.Fp,i),u=Sb(a.n,o.Fn,i),m=["Gx","Gy","a","d"];for(const g of m)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 $O(t,a){return function(i){const l=t(i);return{secretKey:l,publicKey:a(l)}}}const Ha=BigInt(0),Lt=BigInt(1),Lf=BigInt(2),GO=BigInt(8);function XO(t,a,o,i){const l=t.sqr(o),u=t.sqr(i),f=t.add(t.mul(a.a,l),u),m=t.add(t.ONE,t.mul(a.d,t.mul(l,u)));return t.eql(f,m)}function ZO(t,a={}){const o=a,i=VO("edwards",t,o,o.FpFnLE),{Fp:l,Fn:u}=i;let f=i.CURVE;const{h:m}=f;Gm(o,{},{uvRatio:"function"});const g=Lf<<BigInt(u.BYTES*8)-Lt,p=w=>l.create(w),y=o.uvRatio===void 0?(w,E)=>{try{return{isValid:!0,value:l.sqrt(l.div(w,E))}}catch{return{isValid:!1,value:Ha}}}:o.uvRatio;if(!XO(l,f,f.Gx,f.Gy))throw new Error("bad curve params: generator point");function v(w,E,C=!1){const j=C?Lt:Ha;return sc("coordinate "+w,E,j,g),E}function k(w){if(!(w instanceof S))throw new Error("EdwardsPoint expected")}class S{static BASE=new S(f.Gx,f.Gy,Lt,p(f.Gx*f.Gy));static ZERO=new S(Ha,Lt,Lt,Ha);static Fp=l;static Fn=u;X;Y;Z;T;constructor(E,C,j,_){this.X=v("x",E),this.Y=v("y",C),this.Z=v("z",j,!0),this.T=v("t",_),Object.freeze(this)}static CURVE(){return f}static fromAffine(E){if(E instanceof S)throw new Error("extended point not allowed");const{x:C,y:j}=E||{};return v("x",C),v("y",j),new S(C,j,Lt,p(C*j))}static fromBytes(E,C=!1){const j=l.BYTES,{a:_,d:N}=f;E=Zs(Pa(E,j,"point")),Bx(C,"zip215");const O=Zs(E),M=E[j-1];O[j-1]=M&-129;const L=Xs(O),U=C?g:l.ORDER;sc("point.y",L,Ha,U);const q=p(L*L),ae=p(q-Lt),ee=p(N*q-_);let{isValid:F,value:J}=y(ae,ee);if(!F)throw new Error("bad point: invalid y coordinate");const X=(J&Lt)===Lt,V=(M&128)!==0;if(!C&&J===Ha&&V)throw new Error("bad point: x=0 and x_0=1");return V!==X&&(J=p(-J)),S.fromAffine({x:J,y:L})}static fromHex(E,C=!1){return S.fromBytes(AO(E),C)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(E=8,C=!0){return T.createCache(this,E),C||this.multiply(Lf),this}assertValidity(){const E=this,{a:C,d:j}=f;if(E.is0())throw new Error("bad point: ZERO");const{X:_,Y:N,Z:O,T:M}=E,L=p(_*_),U=p(N*N),q=p(O*O),ae=p(q*q),ee=p(L*C),F=p(q*p(ee+U)),J=p(ae+p(j*p(L*U)));if(F!==J)throw new Error("bad point: equation left != right (1)");const X=p(_*N),V=p(O*M);if(X!==V)throw new Error("bad point: equation left != right (2)")}equals(E){k(E);const{X:C,Y:j,Z:_}=this,{X:N,Y:O,Z:M}=E,L=p(C*M),U=p(N*_),q=p(j*M),ae=p(O*_);return L===U&&q===ae}is0(){return this.equals(S.ZERO)}negate(){return new S(p(-this.X),this.Y,this.Z,p(-this.T))}double(){const{a:E}=f,{X:C,Y:j,Z:_}=this,N=p(C*C),O=p(j*j),M=p(Lf*p(_*_)),L=p(E*N),U=C+j,q=p(p(U*U)-N-O),ae=L+O,ee=ae-M,F=L-O,J=p(q*ee),X=p(ae*F),V=p(q*F),D=p(ee*ae);return new S(J,X,D,V)}add(E){k(E);const{a:C,d:j}=f,{X:_,Y:N,Z:O,T:M}=this,{X:L,Y:U,Z:q,T:ae}=E,ee=p(_*L),F=p(N*U),J=p(M*j*ae),X=p(O*q),V=p((_+N)*(L+U)-ee-F),D=X-J,P=X+J,I=p(F-C*ee),$=p(V*D),Z=p(P*I),R=p(V*I),B=p(D*P);return new S($,Z,B,R)}subtract(E){return k(E),this.add(E.negate())}multiply(E){if(!u.isValidNot0(E))throw new RangeError("invalid scalar: expected 1 <= sc < curve.n");const{p:C,f:j}=T.cached(this,E,_=>Rf(S,_));return Rf(S,[C,j])[0]}multiplyUnsafe(E){if(!u.isValid(E))throw new RangeError("invalid scalar: expected 0 <= sc < curve.n");return E===Ha?S.ZERO:this.is0()||E===Lt?this:T.unsafe(this,E,C=>Rf(S,C))}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return T.unsafe(this,f.n).is0()}toAffine(E){const C=this;let j=E;const{X:_,Y:N,Z:O}=C,M=C.is0();j==null&&(j=M?GO:l.inv(O));const L=p(_*j),U=p(N*j),q=l.mul(O,j);if(M)return{x:Ha,y:Lt};if(q!==Lt)throw new Error("invZ was invalid");return{x:L,y:U}}clearCofactor(){return m===Lt?this:this.multiplyUnsafe(m)}toBytes(){const{x:E,y:C}=this.toAffine(),j=l.toBytes(C);return j[j.length-1]|=E&Lt?128:0,j}toHex(){return Hx(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const T=new YO(S,u.BITS);return u.BITS>=8&&S.BASE.precompute(8),Object.freeze(S.prototype),Object.freeze(S),S}class QO{static BASE;static ZERO;static Fp;static Fn;ep;constructor(a){this.ep=a}static fromBytes(a){gb()}static fromHex(a){gb()}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 Hx(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 Ls=BigInt(0),ho=BigInt(1),Ol=BigInt(2);function JO(t){return Gm(t,{P:"bigint",type:"string",adjustScalarBytes:"function",powPminus2:"function"},{randomBytes:"function"}),Object.freeze({...t})}function e6(t){const a=JO(t),{P:o,type:i,adjustScalarBytes:l,powPminus2:u,randomBytes:f}=a,m=i==="x25519";if(!m&&i!=="x448")throw new Error("invalid type");const g=f===void 0?_O:f,p=m?255:448,y=m?32:56,v=BigInt(m?9:5),k=BigInt(m?121665:39081),S=m?Ol**BigInt(254):Ol**BigInt(447),T=m?BigInt(8)*Ol**BigInt(251)-ho:BigInt(4)*Ol**BigInt(445)-ho,w=S+T+ho,E=X=>at(X,o),C=j(v);function j(X){return Ix(E(X),y)}function _(X){const V=Zs(Pa(X,y,"uCoordinate"));return m&&(V[31]&=127),E(Xs(V))}function N(X){return Xs(l(Zs(Pa(X,y,"scalar"))))}function O(X,V){const D=ae(_(V),N(X));if(D===Ls)throw new Error("invalid private or public key received");return j(D)}function M(X){return O(X,C)}const L=M,U=O;function q(X,V,D){const P=E(X*(V-D));return V=E(V-P),D=E(D+P),{x_2:V,x_3:D}}function ae(X,V){sc("u",X,Ls,o),sc("scalar",V,S,w);const D=V,P=X;let I=ho,$=Ls,Z=X,R=ho,B=Ls;for(let ne=BigInt(p-1);ne>=Ls;ne--){const de=D>>ne&ho;B^=de,{x_2:I,x_3:Z}=q(B,I,Z),{x_2:$,x_3:R}=q(B,$,R),B=de;const fe=I+$,ue=E(fe*fe),ie=I-$,le=E(ie*ie),ce=ue-le,me=Z+R,Te=Z-R,Ne=E(Te*fe),Se=E(me*ie),rt=Ne+Se,xt=Ne-Se;Z=E(rt*rt),R=E(P*E(xt*xt)),I=E(ue*le),$=E(ce*(ue+E(k*ce)))}({x_2:I,x_3:Z}=q(B,I,Z)),{x_2:$,x_3:R}=q(B,$,R);const re=u($);return E(I*re)}const ee={secretKey:y,publicKey:y,seed:y},F=X=>(X=X===void 0?g(y):X,Pa(X,ee.seed,"seed"),X),J={randomSecretKey:F};return Object.freeze(ee),Object.freeze(J),Object.freeze({keygen:$O(F,L),getSharedSecret:U,getPublicKey:L,scalarMult:O,scalarMultBase:M,utils:J,GuBytes:C.slice(),lengths:ee})}const t6=BigInt(0),Ps=BigInt(1),Eb=BigInt(2),n6=BigInt(3),a6=BigInt(5),r6=BigInt(8),To=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),Jx={p:To,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:r6,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function e1(t){const a=BigInt(10),o=BigInt(20),i=BigInt(40),l=BigInt(80),u=To,m=t*t%u*t%u,g=bn(m,Eb,u)*m%u,p=bn(g,Ps,u)*t%u,y=bn(p,a6,u)*p%u,v=bn(y,a,u)*y%u,k=bn(v,o,u)*v%u,S=bn(k,i,u)*k%u,T=bn(S,l,u)*S%u,w=bn(T,l,u)*S%u,E=bn(w,a,u)*y%u;return{pow_p_5_8:bn(E,Eb,u)*t%u,b2:m}}function o6(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}const um=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function t1(t,a){const o=To,i=at(a*a*a,o),l=at(i*i*a,o),u=e1(t*l).pow_p_5_8;let f=at(t*i*u,o);const m=at(a*f*f,o),g=f,p=at(f*um,o),y=m===t,v=m===at(-t,o),k=m===at(-t*um,o);return y&&(f=g),(v||k)&&(f=p),vr(f,o)&&(f=at(-f,o)),{isValid:y||v,value:f}}const go=ZO(Jx,{uvRatio:t1}),yr=go.Fp,s6=go.Fn,dm=(()=>{const t=To;return e6({P:t,type:"x25519",powPminus2:a=>{const{pow_p_5_8:o,b2:i}=e1(a);return at(bn(o,n6,t)*i,t)},adjustScalarBytes:o6})})(),Cb=um,i6=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Tb=t=>t1(Ps,t),l6=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),c6=t=>yr.create(Xs(t)&l6);class Xt extends QO{static BASE=new Xt(go.BASE);static ZERO=new Xt(go.ZERO);static Fp=yr;static Fn=s6;constructor(a){super(a)}static fromAffine(a){return new Xt(go.fromAffine(a))}assertSame(a){if(!(a instanceof Xt))throw new Error("RistrettoPoint expected")}init(a){return new Xt(a)}static fromBytes(a){la(a,32);const{a:o,d:i}=Jx,l=To,u=N=>yr.create(N),f=c6(a);if(!DO(yr.toBytes(f),a)||vr(f,l))throw new Error("invalid ristretto255 encoding 1");const m=u(f*f),g=u(Ps+o*m),p=u(Ps-o*m),y=u(g*g),v=u(p*p),k=u(o*i*y-v),{isValid:S,value:T}=Tb(u(k*v)),w=u(T*p),E=u(T*w*k);let C=u((f+f)*w);vr(C,l)&&(C=u(-C));const j=u(g*E),_=u(C*j);if(!S||vr(_,l)||j===t6)throw new Error("invalid ristretto255 encoding 2");return new Xt(new go(C,j,Ps,_))}static fromHex(a){return Xt.fromBytes($m(a))}toBytes(){let{X:a,Y:o,Z:i,T:l}=this.ep;const u=To,f=E=>yr.create(E),m=f(f(i+o)*f(i-o)),g=f(a*o),p=f(g*g),{value:y}=Tb(f(m*p)),v=f(y*m),k=f(y*g),S=f(v*k*l);let T;if(vr(l*S,u)){let E=f(o*Cb),C=f(a*Cb);a=E,o=C,T=f(v*i6)}else T=k;vr(a*S,u)&&(o=f(-o));let w=f((i-o)*T);return vr(w,u)&&(w=f(-w)),yr.toBytes(w)}equals(a){this.assertSame(a);const{X:o,Y:i}=this.ep,{X:l,Y:u}=a.ep,f=p=>yr.create(p),m=f(o*u)===f(i*l),g=f(i*u)===f(o*l);return m||g}is0(){return this.equals(Xt.ZERO)}}Object.freeze(Xt.BASE);Object.freeze(Xt.ZERO);Object.freeze(Xt.prototype);Object.freeze(Xt);class Nb{oHash;iHash;blockLen;outputLen;canXOF=!1;finished=!1;destroyed=!1;constructor(a,o){if(Ym(a),la(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),Gs(l)}update(a){return rc(this),this.iHash.update(a),this}digestInto(a){rc(this),Mx(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:m}=this;return a=a,a.finished=l,a.destroyed=u,a.blockLen=f,a.outputLen=m,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 n1=(()=>{const t=((a,o,i)=>new Nb(a,o).update(i).digest());return t.create=(a,o)=>new Nb(a,o),t})();function u6(t,a,o){return Ym(t),o===void 0&&(o=new Uint8Array(t.outputLen)),n1(t,o,a)}const zf=Uint8Array.of(0),jb=Uint8Array.of();function d6(t,a,o,i=32){Ym(t),Co(i,"length"),la(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=jb:la(o,void 0,"info");const f=new Uint8Array(u*l),m=n1.create(t,a),g=m._cloneInto(),p=new Uint8Array(m.outputLen);for(let y=0;y<u;y++)zf[0]=y+1,g.update(y===0?jb:p).update(o).update(zf).digestInto(p),f.set(p,l*y),m._cloneInto(g);return m.destroy(),g.destroy(),Gs(p,zf),f.slice(0,i)}const Qs=(t,a,o,i,l)=>d6(t,u6(t,a,o),i,l),xn=2,Ab=32,f6=32,Ia=32,m6=24,fm=32,a1=32,p6=6,mm=32,r1="hive/remote/v1/pair",h6="hive/remote/v1/key/daemon->device",g6="hive/remote/v1/key/device->daemon",v6="hive/remote/v1/sas",y6="hive/remote/v1/transcript",b6="hive/remote/v2/conn/daemon->device",w6="hive/remote/v2/conn/device->daemon",x6="hive/remote/v2/conn-salt",k6=1,S6=2,E6=4,C6=8,o1=12,T6=new TextEncoder;function Qt(t){return T6.encode(t)}function Mn(...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 Ac(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 Qm(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 N6(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 lc(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 mn(t,a,o){if(t.length!==a)throw new RangeError(`${o} must be ${a} bytes, got ${t.length}`)}const wn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",j6=(()=>{const t=new Int16Array(128).fill(-1);for(let a=0;a<wn.length;a++)t[wn.charCodeAt(a)]=a;return t})();function wr(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+=wn[l>>2],a+=wn[(l&3)<<4|u>>4],a+=wn[(u&15)<<2|f>>6],a+=wn[f&63]}const i=t.length-o;if(i===1){const l=t[o];a+=wn[l>>2],a+=wn[(l&3)<<4]}else if(i===2){const l=t[o],u=t[o+1];a+=wn[l>>2],a+=wn[(l&3)<<4|u>>4],a+=wn[(u&15)<<2]}return a}function Js(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 p=j6[g];if(p<0)throw new RangeError("invalid base64url");return p};let f=0,m=0;for(;m+4<=t.length;m+=4){const g=u(t.charCodeAt(m)),p=u(t.charCodeAt(m+1)),y=u(t.charCodeAt(m+2)),v=u(t.charCodeAt(m+3));l[f++]=g<<2|p>>4,l[f++]=(p&15)<<4|y>>2,l[f++]=(y&3)<<6|v}if(o===2){const g=u(t.charCodeAt(m)),p=u(t.charCodeAt(m+1));l[f++]=g<<2|p>>4}else if(o===3){const g=u(t.charCodeAt(m)),p=u(t.charCodeAt(m+1)),y=u(t.charCodeAt(m+2));l[f++]=g<<2|p>>4,l[f++]=(p&15)<<4|y>>2}return l}function A6(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!==xn)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(Js(o.pairingSecret).length!==fm)throw new RangeError(`pairingSecret must be ${fm} bytes`);return{v:o.v,gatewayUrl:o.gatewayUrl,daemonId:o.daemonId,pairingSecret:o.pairingSecret}}function R6(){const t=dm.utils.randomSecretKey(),a=dm.getPublicKey(t);return{secretKey:t,publicKey:a}}function O6(t){return{secretKey:wr(t.secretKey),publicKey:wr(t.publicKey)}}function D6(){return Rx(a1)}function M6(t){mn(t.pairingSecret,fm,"pairingSecret"),mn(t.sessionSalt,a1,"sessionSalt"),mn(t.daemonPublicKey,Ab,"daemonPublicKey"),mn(t.devicePublicKey,Ab,"devicePublicKey");const a=dm.getSharedSecret(t.localSecretKey,t.peerPublicKey);mn(a,f6,"sharedSecret");const o=Mn(t.pairingSecret,a),i=Mn(Qt(y6),Uint8Array.of(0),Ac(t.ids.protocolVersion),lc(Qt(t.ids.daemonId)),lc(Qt(t.ids.deviceId)),t.daemonPublicKey,t.devicePublicKey,t.sessionSalt),l=wo(i),u=Mn(Qt(r1),t.sessionSalt),f=Qs(wo,o,u,Mn(Qt(h6),Uint8Array.of(0),l),Ia),m=Qs(wo,o,u,Mn(Qt(g6),Uint8Array.of(0),l),Ia),g=B6(l,t.ids);return{d2p:f,p2d:m,sas:g,transcriptHash:l}}function L6(t){return M6({localSecretKey:t.deviceSecretKey,peerPublicKey:t.daemonPublicKey,daemonPublicKey:t.daemonPublicKey,devicePublicKey:t.devicePublicKey,pairingSecret:t.pairingSecret,sessionSalt:t.sessionSalt,ids:t.ids})}function z6(){return Rx(mm)}function H6(t){mn(t.rootD2p,Ia,"rootD2p"),mn(t.rootP2d,Ia,"rootP2d"),mn(t.phoneConnSalt,mm,"phoneConnSalt"),mn(t.daemonConnSalt,mm,"daemonConnSalt");const a=Mn(Qt(x6),t.phoneConnSalt,t.daemonConnSalt),o=Mn(Uint8Array.of(0),Ac(t.ids.protocolVersion),lc(Qt(t.ids.daemonId)),lc(Qt(t.ids.deviceId)),t.phoneConnSalt,t.daemonConnSalt),i=Qs(wo,t.rootD2p,a,Mn(Qt(b6),o),Ia),l=Qs(wo,t.rootP2d,a,Mn(Qt(w6),o),Ia);return{d2p:i,p2d:l}}function B6(t,a){mn(t,32,"transcriptHash");const o=Qs(wo,t,Qt(r1),Mn(Qt(v6),Uint8Array.of(0),Ac(a.protocolVersion)),4);return(Qm(o)%1e6).toString().padStart(p6,"0")}function s1(t,a,o){if(!Number.isInteger(a)||a<0||a>4294967295)throw new RangeError(`streamId out of range: ${a}`);const i=new Uint8Array(m6);return i[0]=t==="d2p"?k6:S6,i.set(Ac(a),1),i.set(N6(o),8),i}function i1(t){if(t.length<o1)throw new RangeError("headerBytes too short");return Qm(t,E6)}function _c(t){if(t.length<o1)throw new RangeError("headerBytes too short");return Qm(t,C6)}function U6(t){mn(t.key,Ia,"key");const a=i1(t.headerBytes),o=_c(t.headerBytes),i=s1(t.direction,a,o);return Dx(t.key,i,t.headerBytes).encrypt(t.payload)}function W6(t){mn(t.key,Ia,"key");const a=i1(t.headerBytes),o=_c(t.headerBytes),i=s1(t.direction,a,o);return Dx(t.key,i,t.headerBytes).decrypt(t.ciphertext)}function I6(t){return{direction:t,nextSeq:0}}function q6(t){return{direction:t,lastSeq:-1}}function P6(t,a){const o=_c(a.headerBytes);if(o!==t.nextSeq)throw new RangeError(`header seq ${o} does not match sealer.nextSeq ${t.nextSeq}`);const i=U6({key:a.key,direction:t.direction,headerBytes:a.headerBytes,payload:a.payload}),l=t.nextSeq;return t.nextSeq+=1,{seq:l,ciphertext:i}}function F6(t,a){if(a.seq!==t.lastSeq+1)throw new RangeError("out-of-order or replayed frame");if(_c(a.headerBytes)!==a.seq)throw new RangeError("out-of-order or replayed frame");const i=W6({key:a.key,direction:t.direction,headerBytes:a.headerBytes,ciphertext:a.ciphertext});return t.lastSeq=a.seq,i}const K6=(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)}`},Y6=t=>typeof t=="object"&&t!==null&&typeof t.t=="string",V6=2e4,$6=1e4;function G6(t,a,o){const i=o.generateKeyPair??R6,l=o.generateSalt??D6,u=o.heartbeatMs??V6,f=o.heartbeatDeadlineMs??$6;let m="idle",g=null,p=null,y=null,v=!1,k=null,S=null,T=null,w=null,E=null,C=null,j="",_="",N=null;const O=Z=>{m=Z,a.onPhase(Z)},M=()=>{S!==null&&(clearTimeout(S),S=null)},L=()=>{k!==null&&(clearInterval(k),k=null),M()},U=Z=>{L(),k=setInterval(()=>{if(!v){try{Z.send(jx)}catch{}S===null&&(S=setTimeout(()=>{if(S=null,!v){try{Z.close()}catch{}V()}},f))}},u)},q=()=>{T?.secretKey.fill(0),w?.fill(0),E&&(E.d2p.fill(0),E.p2d.fill(0),E.transcriptHash.fill(0)),T=null,w=null,E=null},ae=Z=>{if(!v){v=!0,L(),q();try{y?.close()}catch{}y=null,N?.(Z)}},ee=(Z,R)=>{if(v)return;const B={code:Z,message:R};O(Z==="rejected"?"rejected":Z==="expired"?"expired":"error"),a.onFailure(B),ae({ok:!1,failure:B})},F=Z=>{if(m!=="connecting"&&m!=="handshaking")return;if(Z.protocolVersion!==xn){ee("protocol_version",`unsupported pairing protocol version ${Z.protocolVersion}`);return}if(!T||!w){ee("pair_ack_invalid","pair-ack arrived before the phone keypair was ready");return}let R;try{R=Js(Z.daemonPublicKey)}catch{ee("pair_ack_invalid","pair-ack daemonPublicKey is not valid base64url");return}const B={daemonId:Z.daemonId,deviceId:Z.deviceId,protocolVersion:Z.protocolVersion};try{E=L6({deviceSecretKey:T.secretKey,daemonPublicKey:R,devicePublicKey:T.publicKey,pairingSecret:I,sessionSalt:w,ids:B})}catch(re){ee("pair_ack_invalid",`handshake derivation failed: ${re.message}`);return}p=Z.deviceId,_=Z.daemonId,C=Z.daemonPublicKey,g=E.sas,O("awaiting_confirm"),a.onSas(g)},J=()=>{if(!v){if(!E||!T||!p){ee("pair_ack_invalid","cannot mint before the handshake produced a session");return}O("minting"),o.mintSession(j,{daemonId:_,deviceId:p}).then(()=>{if(v||!T||!C||!p||!E)return;const Z={v:2,gatewayUrl:j,daemonId:_,deviceId:p,deviceKeyPair:O6(T),daemonPublicKey:C,rootKeys:{d2p:wr(E.d2p),p2d:wr(E.p2d)},protocolVersion:xn,pairedAt:(o.now??Date.now)()};o.store.save(Z);const R=p;O("paired"),ae({ok:!0,deviceId:R})}).catch(Z=>{Z.status===403?ee("mint_forbidden","gateway refused to mint a device session (not confirmed)"):ee("mint_failed",`device session mint failed: ${Z.message??"unknown"}`)})}},X=Z=>{if(m==="awaiting_confirm"){if(!E||!T||!p||Z.deviceId!==p){ee("pair_ack_invalid","confirmed for an unexpected device");return}J()}},V=()=>{if(!v){if(m==="awaiting_confirm"){J();return}m!=="minting"&&ee("socket_closed","pairing socket closed before the device was paired")}},D=Z=>{if(v||typeof Z!="string")return;if(Z===Ax){M();return}let R;try{R=JSON.parse(Z)}catch{return}if(Y6(R))switch(m==="connecting"&&R.t==="pair-ack"&&O("handshaking"),R.t){case"pair-ack":F(R);break;case"confirmed":X(R);break;case"rejected":{const B=R.reason;B==="expired"||B==="pairing_expired"?ee("expired","pairing code expired; generate a new pairing code"):ee("rejected",B??"pairing rejected at the desktop")}break}},P=_6(t),I=Js(P.pairingSecret);return j=P.gatewayUrl,_=P.daemonId,{get phase(){return m},get sas(){return g},get deviceId(){return p},start:()=>v?Promise.resolve({ok:!1,failure:{code:"cancelled",message:"already settled"}}):new Promise(Z=>{N=Z,T=i(),w=l(),O("connecting");const R=K6(P.gatewayUrl,P.daemonId);try{y=o.openSocket(R)}catch(B){ee("socket_closed",`failed to open pairing socket: ${B.message}`);return}y.addEventListener("open",()=>{if(v||!y||!T||!w)return;U(y);const B={t:"hello",devicePublicKey:wr(T.publicKey),sessionSalt:wr(w),...o.proposedName?{proposedName:o.proposedName}:{},...o.boundJti?{boundJti:o.boundJti}:{}};y?.send(JSON.stringify(B))}),y.addEventListener("message",B=>{D(B.data)}),y.addEventListener("close",V),y.addEventListener("error",V)}),cancel:()=>{v||(O("rejected"),ee("cancelled","pairing cancelled"))},dispose:()=>{v?q():ae({ok:!1,failure:{code:"cancelled",message:"disposed"}})}}}const X6=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 Z6(t){const a=t.fetchImpl??globalThis.fetch.bind(globalThis),o=t.gatewayBaseUrl??window.location.origin,i=t.redirect??(T=>window.location.assign(T)),l=t.createPairing??G6,u=t.mintSession??X6(a);let f=t.authProvider??"github",m="login",g=null;const p=T=>{m=T,t.onPhase?.(T)},y=T=>t.store.load(o,T),v=async T=>{T&&(f=T);const w=await a(`${o}/pair/machines`,{credentials:"include"});if(w.status===401){const j=encodeURIComponent(window.location.pathname+window.location.search);return p("login"),i(`${o}/auth/${f}?redirect=${j}`),{daemons:[],selfDeviceId:null}}if(!w.ok)throw new Error(`Failed to load machines: ${w.status}`);const E=await w.json(),C=E.daemons.map(j=>({id:j.id,name:j.name,lastSeen:j.lastSeen,revoked:j.revoked,online:j.online}));return p("machines"),{daemons:C,selfDeviceId:E.self.deviceId}},k=T=>{p("pairing");const E=l(T,{onPhase:C=>t.onPairingPhase?.(C),onSas:C=>t.onPairingSas?.(C),onFailure:C=>t.onPairingFailure?.(C)},{openSocket:(C,j)=>new WebSocket(C,j),store:t.store,mintSession:u,...t.proposedName?{proposedName:t.proposedName}:{},...t.boundJti?{boundJti:t.boundJti}:{}});return g=E,E.start()};return{get phase(){return m},get pairingClient(){return g},loadMachines:v,selectDaemon:async(T,w)=>{g=null;const E=y(T);if(E&&!w){const N=await t.connectTransport({daemonId:T,deviceId:E.deviceId,stored:E});return N.ok?(p("connected"),N):(!N.ok&&N.failure.code==="relay_revoked"&&t.store.clear(o,T),p("selecting"),N)}if(p("selecting"),!w)return{ok:!1,failure:{code:"needs_pairing",message:"this device is not paired with that computer — enter its pairing code first"}};const C=await k(w);if(!C.ok)return C;const j=y(T),_=await t.connectTransport({daemonId:T,deviceId:C.deviceId,stored:j});return _.ok?(p("connected"),_):(_.failure.code==="relay_revoked"&&t.store.clear(o,T),p("selecting"),_)}}}const l1="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Q6=12,J6="hive-remote-pairing-code-v1:",eD=t=>{const a=t.trim().toUpperCase().replace(/[\s-]+/g,"").replace(/O/g,"0").replace(/[IL]/g,"1");if(a.length!==Q6)return null;for(const o of a)if(!l1.includes(o))return null;return a},tD=new TextEncoder,nD=t=>new URL(t).origin,aD=async t=>{const a=eD(t.code);if(!a)return null;const o=await crypto.subtle.digest("SHA-256",tD.encode(`${J6}${a}`));return A6({v:xn,gatewayUrl:nD(t.gatewayUrl),daemonId:t.daemonId,pairingSecret:wr(new Uint8Array(o))})},rD="hive.device-session.v2",oD="hive.device-session.v1",Hf=(t,a)=>`${rD}:${t}:${a}`,_b=(t,a)=>`${oD}:${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"},iD=(t=globalThis.localStorage??null)=>({load:(a,o)=>{if(!t)return null;t.getItem(_b(a,o))!==null&&t.removeItem(_b(a,o));const i=t.getItem(Hf(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(Hf(a.gatewayUrl,a.daemonId),JSON.stringify(a))},clear:(a,o)=>{t&&t.removeItem(Hf(a,o))}}),c1=()=>{const t=window.location.hostname;return!(t==="127.0.0.1"||t==="localhost"||t==="[::1]"||t==="::1")},u1=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}},lD=(t,a)=>{const o=u1(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}},cD=t=>t==="select_failed"?"connect.error.selectFailed":t==="invalid_code"?"connect.error.invalidCode":t==="relay_revoked"?"connect.machines.revokedHint":null,uD=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`},dD={O:"0",I:"1",L:"1"},fD=t=>{const a=t.toUpperCase();let o="";for(const l of a){const u=dD[l]??l;if(l1.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("-")},mD=t=>t==="minting"||t==="paired",Dl=({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}),zs=({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}),pD=({flow:t,phase:a,machines:o,selectedMachineId:i,pairingPhase:l,pairingFailureCode:u,connectError:f,sas:m,isSigningIn:g=!1,pendingMachineId:p,loginError:y=!1,isGatewayBundle:v=!1,onRefreshMachines:k,onSelectProvider:S,onSelectMachine:T,onSubmitCode:w,onCancelPairing:E,onGoBack:C})=>{const{t:j}=we(),[_,N]=b.useState(""),O=b.useRef(!1),M=lD(l,u),L=cD(f),U=u1(u)!=null,q=mD(l),ae=m!=null&&m.length>0&&(l==="awaiting_confirm"||q),ee=V=>{const D=fD(V);N(D),D.replace(/-/g,"").length===12&&i&&!O.current&&(O.current=!0,w(i,D.trim()))},F=_.replace(/-/g,"").length===12,J=!!i&&F,X=v?"/brand/icon-192.png":"/logo.png";if(a==="login")return c.jsxs(Dl,{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:X,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:j("connect.login.heading")}),c.jsx("p",{className:"mt-2 text-sm text-ter",children:j("connect.login.subtitle")})]}),y?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:j("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:j("connect.login.signingIn")}):c.jsxs(c.Fragment,{children:[c.jsx(zs,{primary:!0,testId:"connect-login-github",onClick:()=>S("github"),children:j("connect.login.github")}),c.jsx(zs,{testId:"connect-login-google",onClick:()=>S("google"),children:j("connect.login.google")})]})})]});if(a==="machines"){const V=p!=null;return c.jsxs(Dl,{testId:"connect-machines",className:"gap-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("img",{src:X,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:j("connect.machines.heading")}),k?c.jsx("button",{type:"button","aria-label":j("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(xm,{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:j(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(Qd,{size:28})}),c.jsx("p",{"data-testid":"connect-machines-empty",className:"max-w-[280px] text-sm text-ter",children:j("connect.machines.empty")}),c.jsx("div",{className:"flex w-full max-w-[320px] flex-col gap-3 pt-2",children:c.jsx(zs,{testId:"connect-machines-back",...C?{onClick:C}:{},children:j("connect.machines.back")})})]}):c.jsx("ul",{className:"flex flex-col gap-2.5",children:o.map(D=>{const P=p===D.id,I=!D.online||D.revoked||V;let $,Z="var(--text-tertiary)";if(D.revoked)$=j("connect.machines.revoked"),Z="var(--status-red)";else if(D.online)P?($=j("connect.machines.connecting"),Z="var(--text-secondary)"):($=j("connect.machines.online"),Z="var(--status-green)");else{const B=D.lastSeen!=null?uD(D.lastSeen):null;$=B!=null?j("connect.machines.lastSeen",{ago:B}):j("connect.machines.offline")}const R=D.revoked?"var(--status-red)":D.online?"var(--status-green)":"var(--text-tertiary)";return c.jsx("li",{children:c.jsxs("button",{type:"button","data-testid":`connect-machine-${D.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:()=>T(D.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(Qd,{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:D.name}),c.jsx("span",{className:"mt-0.5 block text-xs",style:{color:Z},children:$})]}),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(fc,{size:18,className:"shrink-0 text-ter","aria-hidden":!0})]})},D.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:j("connect.machines.manageDevices")})}):null]})}if(a==="selecting"){const V=o.find(D=>D.id===i);return c.jsxs(Dl,{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:C,children:[c.jsx(gS,{size:16,"aria-hidden":!0}),j("connect.pair.back")]}),c.jsxs("div",{children:[c.jsx("h1",{className:"text-xl font-semibold text-pri",children:j("connect.pair.guideHeading")}),V?c.jsxs("p",{className:"mt-1 flex items-center gap-1.5 text-sm text-ter",children:[c.jsx(Qd,{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:j(L)}):null,c.jsx("ol",{className:"flex flex-col gap-3",children:["connect.pair.guideStep1","connect.pair.guideStep2","connect.pair.guideStep3"].map((D,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:j(D)})]},D))}),c.jsxs("label",{className:"flex flex-col gap-2 text-xs uppercase tracking-wider text-ter",children:[j("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:_,onChange:D=>{O.current=!1,ee(D.target.value)},style:{fontSize:"18px",letterSpacing:"0.12em",minHeight:"52px"}})]}),c.jsx(zs,{primary:!0,testId:"connect-code-submit",disabled:!J,onClick:()=>{i&&!O.current&&(O.current=!0,w(i,_.trim()))},children:j("connect.pair.submit")})]})}if(a==="pairing"){const V=U;return c.jsxs(Dl,{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:m}),c.jsx("p",{className:"text-center text-sm text-ter",style:{maxWidth:"280px"},children:j(q?"connect.pair.finalizing":"connect.pair.sasInstruction")}),q?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,M&&!ae&&!V?c.jsx("p",{"data-testid":"connect-pairing-phase",className:"text-center text-sm text-ter",children:j(M)}):null,V&&M?c.jsx("p",{"data-testid":"connect-pairing-phase",className:"text-center text-sm",style:{color:"var(--status-red)"},children:j(M)}):null,q?null:c.jsx("div",{className:"flex flex-col gap-3",children:c.jsx(zs,{primary:V,testId:"connect-pairing-cancel",onClick:()=>{N(""),O.current=!1,E?E():t.pairingClient?.cancel()},children:j(V?"connect.pair.startOver":"common.cancel")})})]})}return null},hD=()=>{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)},gD=({children:t,connectTransport:a,createFlow:o=Z6,store:i,gatewayBaseUrl:l,isGateway:u=c1})=>{const f=u(),[m,g]=b.useState("login"),[p,y]=b.useState([]),[v,k]=b.useState(null),[S,T]=b.useState(void 0),[w,E]=b.useState(null),[C,j]=b.useState(null),[_,N]=b.useState(null),[O,M]=b.useState(null),[L,U]=b.useState(!1),[q,ae]=b.useState(null),[ee,F]=b.useState(!1),[J,X]=b.useState(!0),V=b.useMemo(()=>o({store:i??iD(),connectTransport:a,...l?{gatewayBaseUrl:l}:{},proposedName:hD(),onPhase:g,onPairingPhase:ue=>{E(ue),ue!=="error"&&ue!=="expired"&&ue!=="rejected"&&j(null)},onPairingSas:M,onPairingFailure:ue=>j(ue.code)}),[o,i,a,l]),D=b.useRef(V);D.current=V;const P=b.useRef(0),I=b.useCallback(()=>{E(null),j(null),M(null)},[]),$=b.useCallback(()=>(P.current+=1,P.current),[]),Z=b.useCallback(ue=>P.current===ue,[]);b.useEffect(()=>{let ue=!1;return D.current.loadMachines().then(({daemons:ie,selfDeviceId:le})=>{ue||(y(ie),k(le))}).catch(()=>{}).finally(()=>{ue||X(!1)}),()=>{ue=!0}},[]);const R=b.useCallback(()=>{const ue=$();N(null),I(),U(!0),D.current.loadMachines().then(({daemons:ie,selfDeviceId:le})=>{Z(ue)&&(y(ie),k(le))}).finally(()=>{Z(ue)&&U(!1)})},[I,Z,$]),B=b.useCallback(ue=>{const ie=$();N(null),I(),F(!1),U(!0),D.current.loadMachines(ue).then(({daemons:le,selfDeviceId:ce})=>{Z(ie)&&(y(le),k(ce))}).catch(()=>{Z(ie)&&F(!0)}).finally(()=>{Z(ie)&&U(!1)})},[I,Z,$]),re=b.useCallback(ue=>{const ie=$();T(ue),N(null),I(),ae(ue),(async()=>{const le=await D.current.selectDaemon(ue);Z(ie)&&(ae(null),!le.ok&&le.failure.code==="select_failed"&&N("select_failed"),!le.ok&&le.failure.code==="relay_revoked"&&N("relay_revoked"))})()},[I,Z,$]),ne=b.useCallback((ue,ie)=>{const le=$();N(null),I(),(async()=>{const ce=await aD({code:ie,daemonId:ue,gatewayUrl:l??window.location.origin});if(!Z(le))return;if(!ce){N("invalid_code");return}const me=await D.current.selectDaemon(ue,ce);Z(le)&&(!me.ok&&me.failure.code==="select_failed"&&N("select_failed"),!me.ok&&me.failure.code==="relay_revoked"&&N("relay_revoked"))})()},[I,l,Z,$]),de=b.useCallback(()=>{$(),D.current.pairingClient?.cancel(),I(),N(null),g(S?"selecting":"machines")},[I,$,S]),fe=b.useCallback(()=>{$(),N(null),I(),g("machines")},[I,$]);return m==="connected"?(typeof history<"u"&&history.replaceState(null,"","/app"),c.jsx(c.Fragment,{children:t})):J?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(pD,{flow:V,phase:m,machines:p,selfDeviceId:v,...S?{selectedMachineId:S}:{},pairingPhase:w,pairingFailureCode:C,connectError:_,sas:O,isSigningIn:L,pendingMachineId:q,loginError:ee,isGatewayBundle:f,onRefreshMachines:R,onSelectProvider:B,onSelectMachine:re,onSubmitCode:ne,onCancelPairing:de,onGoBack:fe})},vD=(t,a,o)=>t.mode==="tunnel"?c.jsx(o,{connectTransport:t.connectTransport,children:c.jsx(a,{})}):c.jsx(a,{}),$e={Open:1,Data:2,End:3,Reset:4,Ping:5,Ack:6},cc={Http:1,Ws:2},Ht={ProtocolError:1,VersionMismatch:4},Rb={INITIAL_WINDOW:256*1024,ACK_THRESHOLD:32*1024},uc=12,Ob=0,pm=4294967295,d1=4294967295,yD=0,f1=1;class Bt extends Error{code;constructor(a,o){super(a),this.name="ProtocolError",this.code=o}}const bD=new TextEncoder,wD=new TextDecoder;function m1(t){return bD.encode(t)}function Rc(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function hm(t,a){if(!Number.isInteger(t)||t<0||t>d1)throw new RangeError(`${a} out of u32 range: ${t}`)}function p1(t){return t===$e.Open||t===$e.Data||t===$e.End||t===$e.Reset||t===$e.Ping||t===$e.Ack}function h1(t){return(t&-2)===0}function Db(t){if(t.version!==xn)throw new RangeError(`version must be ${xn}`);if(!p1(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===$e.Data){if(!h1(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");hm(t.streamId,"streamId"),hm(t.seq,"seq");const a=new Uint8Array(uc),o=Rc(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 xD(t){if(t.length<uc)throw new Bt("header too short",Ht.ProtocolError);const a=Rc(t),o=a.getUint8(0);if(o!==xn)throw new Bt(`bad version ${o}`,Ht.VersionMismatch);const i=a.getUint8(1);if(!p1(i))throw new Bt(`unknown kind ${i}`,Ht.ProtocolError);const l=a.getUint16(2);if(i===$e.Data){if(!h1(l))throw new Bt("reserved flag bits set on Data frame",Ht.ProtocolError)}else if(l!==0)throw new Bt("flags must be 0 on a non-Data frame",Ht.ProtocolError);const u=a.getUint32(4),f=a.getUint32(8);return{version:o,kind:i,flags:l,streamId:u,seq:f}}function Mb(t){let a;if(t.transport===cc.Http){if(!t.http)throw new RangeError("http meta required for Http transport");a=t.http}else if(t.transport===cc.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=m1(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,Rc(i).setUint16(1,o.length),i.set(o,3),i}function kD(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 Oc={ConnSalt:1,Hello:2},gm={daemon:1,device:2},SD=34;function ED(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]=Oc.ConnSalt,a[1]=gm.device,a.set(t.salt,2),a}function CD(t){if(t.length!==SD)throw new Bt("conn salt must be 34 bytes",Ht.ProtocolError);if(t[0]!==Oc.ConnSalt)throw new Bt("not a ConnSalt frame",Ht.ProtocolError);const a=t[1],o=a===gm.daemon?"daemon":a===gm.device?"device":null;if(o===null)throw new Bt("bad conn salt role",Ht.ProtocolError);return{role:o,salt:t.slice(2)}}function TD(t){return t.length>=1&&t[0]===Oc.ConnSalt}function ND(t){if(t.role!=="daemon"&&t.role!=="device")throw new RangeError(`bad role: ${t.role}`);const a=m1(JSON.stringify(t)),o=new Uint8Array(1+a.length);return o[0]=Oc.Hello,o.set(a,1),o}function jD(t){hm(t,"cumulativeBytes");const a=new Uint8Array(4);return Rc(a).setUint32(0,t),a}function AD(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 Bt("ws message too short",Ht.ProtocolError);const a=t[0];if(a!==0&&a!==1)throw new Bt("bad ws isText flag",Ht.ProtocolError);return{data:t.slice(1),isText:a===1}}function Lb(t){const a=new Uint8Array(1+t.length);return a[0]=f1,a.set(t,1),a}function RD(t){if(t.length<1)throw new Bt("http data too short",Ht.ProtocolError);const a=t[0];if(a===yD){let o;try{o=JSON.parse(wD.decode(t.subarray(1)))}catch{throw new Bt("http head not JSON",Ht.ProtocolError)}const i=o;if(typeof i.status!="number"||!kD(i.headers))throw new Bt("bad http head",Ht.ProtocolError);return{kind:"head",head:{status:i.status,headers:i.headers}}}if(a===f1)return{kind:"body",data:t.slice(1)};throw new Bt(`unknown http disc ${a}`,Ht.ProtocolError)}function zb(t){let a=1;return()=>{a===pm&&(a+=2);const o=a;if(a+=2,a>d1)throw new RangeError("stream id space exhausted; re-handshake required");return o}}const OD={ok:!0};function Hb(t=Rb.INITIAL_WINDOW,a=Rb.ACK_THRESHOLD){let o=0,i=0,l=0,u=0;const f=()=>o-i,m=()=>f()>=t;return{trySend(g){return f()+g>t?{ok:!1,reason:"WindowExhausted"}:(o+=g,OD)},applyAck(g){const p=m();return g<=i?{resumed:!1}:(i=Math.min(g,o),{resumed:p&&!m()})},onConsume(g){return l+=g,l-u>=a?(u=l,{ackCumulative:l}):null},flushAck(){return u=l,{ackCumulative:l}},isPaused:()=>m()}}const DD=1,Bf=256*1024,vm=new TextEncoder,MD=new TextDecoder,LD=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},zD=t=>{if(typeof t=="string")return{bytes:vm.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}},HD=t=>{const a=t.generateConnSalt??z6;let o=null,i=null,l=null,u=null,f=null,m=zb();const g=new Map,p=(_,N)=>{if(_.length!==N.length)return!1;for(let O=0;O<_.length;O++)if(_[O]!==N[O])return!1;return!0},y=(_,N,O,M=0)=>{if(!i||!o)throw new Error("frame-mux: seal before channel handshake complete");const L=Db({version:xn,kind:_,flags:M,streamId:N,seq:i.nextSeq});t.onSeal?.({key:o.p2d,direction:"p2d",headerBytes:L});const{ciphertext:U}=P6(i,{key:o.p2d,headerBytes:L,payload:O}),q=new Uint8Array(L.length+U.length);return q.set(L,0),q.set(U,L.length),q},v=()=>{t.send(y($e.Data,Ob,ND({protocolVersion:xn,role:"device",daemonId:t.daemonId,deviceId:t.deviceId})))},k=_=>{u&&(f&&p(f,_)||(o=H6({rootD2p:t.roots.d2p,rootP2d:t.roots.p2d,phoneConnSalt:u,daemonConnSalt:_,ids:{daemonId:t.daemonId,deviceId:t.deviceId,protocolVersion:xn}}),i=I6("p2d"),l=q6("d2p"),f=Uint8Array.from(_),v(),t.onReady?.()))},S=(_,N)=>{t.send(y($e.Ack,_,jD(N)))},T=(_,N)=>{if(!o)return Promise.reject(new Error("tunnel: channel not ready"));const O=m(),M=(N?.method??"GET").toUpperCase(),L=[];N?.headers&&new Headers(N.headers).forEach((ee,F)=>{L.push([F,ee])});const U=N?.body===void 0||N.body===null?void 0:BD(N.body),q=U!==void 0&&U.length>0;return new Promise((ae,ee)=>{const F={kind:"http",body:[],recvFlow:Hb(),resolve:ae,reject:ee,settled:!1};g.set(O,F),t.send(y($e.Open,O,Mb({transport:cc.Http,http:{method:M,path:_,headers:L,hasBody:q}}))),q&&U?U.length<=Bf?(t.send(y($e.Data,O,Lb(U))),t.send(y($e.End,O,new Uint8Array(0)))):w(O,F,U):t.send(y($e.End,O,new Uint8Array(0)))})},w=async(_,N,O)=>{try{for(let M=0;M<O.length;M+=Bf){if(M>0&&t.awaitDrain&&await t.awaitDrain(),N.settled)return;t.send(y($e.Data,_,Lb(O.subarray(M,M+Bf))))}if(N.settled)return;t.send(y($e.End,_,new Uint8Array(0)))}catch(M){if(N.settled)return;N.settled=!0,g.delete(_),N.reject(M)}},E=(_,N)=>{if(N.settled)return;N.settled=!0,g.delete(_);const O=N.head,M=LD(N.body);if(!O){N.reject(new Error("tunnel: stream ended without an HTTP head"));return}let L=null;if(M.length>0){const U=new ArrayBuffer(M.length);new Uint8Array(U).set(M),L=U}N.resolve(new Response(L,{status:O.status,headers:O.headers}))};class C{OPEN=1;readyState=0;onopen=null;onmessage=null;onclose=null;onerror=null;streamId;constructor(N){this.streamId=N}send(N){if(this.readyState!==this.OPEN)return;const{bytes:O,isText:M}=zD(N);t.send(y($e.Data,this.streamId,AD(O,M)))}close(N,O){if(this.readyState===3)return;const M=this.readyState===this.OPEN;this.readyState=3,M&&t.send(y($e.End,this.streamId,new Uint8Array(0))),g.delete(this.streamId)}_deliver(N,O){this.onmessage&&this.onmessage({data:O?MD.decode(N):N})}_remoteClose(N,O){this.readyState!==3&&(this.readyState=3,g.delete(this.streamId),this.onclose?.(O===void 0?{code:N}:{code:N,reason:O}))}}return{beginChannel(){u=a(),o=null,i=null,l=null,f=null,this.resetAll("rekey"),m=zb();const _=Db({version:xn,kind:$e.Data,flags:0,streamId:pm,seq:0}),N=ED({salt:u}),O=new Uint8Array(_.length+N.length);O.set(_,0),O.set(N,_.length),t.send(O)},onFrame(_){const N=_.subarray(0,uc),O=_.subarray(uc),M=xD(N);if(M.streamId===pm&&TD(O)){const{role:q,salt:ae}=CD(O);q==="daemon"&&k(ae);return}if(!l||!o)return;const L=F6(l,{key:o.d2p,headerBytes:N,ciphertext:O,seq:M.seq});if(M.streamId===Ob)return;const U=g.get(M.streamId);if(U){if(U.kind==="http"){if(M.kind===$e.Reset){U.settled||(U.settled=!0,g.delete(M.streamId),U.reject(new Error("tunnel: HTTP stream reset by daemon")));return}if(M.kind===$e.Data){const q=RD(L);if(q.kind==="head")U.head=q.head;else{U.body.push(q.data);const ae=U.recvFlow.onConsume(q.data.length);ae&&S(M.streamId,ae.ackCumulative)}(M.flags&DD)!==0&&E(M.streamId,U);return}if(M.kind===$e.End){E(M.streamId,U);return}return}if(M.kind===$e.Data){const q=_D(L),ae=U.recvFlow.onConsume(q.data.length);ae&&S(M.streamId,ae.ackCumulative),U.socket._deliver(q.data,q.isText);return}if(M.kind===$e.End||M.kind===$e.Reset){U.socket._remoteClose(M.kind===$e.Reset?1011:1e3);return}}},fetch:T,openWebSocket:(_,N)=>{if(!o){const U=new C(-1);return queueMicrotask(()=>U._remoteClose(1011,"tunnel: channel not ready")),U}const O=m(),M=[];if(N)for(const[U,q]of Object.entries(N))q!==void 0&&M.push([U,String(q)]);const L=new C(O);return g.set(O,{kind:"ws",recvFlow:Hb(),socket:L}),t.send(y($e.Open,O,Mb({transport:cc.Ws,ws:M.length>0?{path:_,query:M}:{path:_}}))),queueMicrotask(()=>{L.readyState===0&&(L.readyState=L.OPEN,L.onopen?.())}),L},resetAll(_){for(const[N,O]of[...g.entries()])g.delete(N),O.kind==="http"?O.settled||(O.settled=!0,O.reject(new Error(`tunnel: connection lost (${_})`))):O.socket._remoteClose(1006,_)}}},BD=t=>typeof t=="string"?vm.encode(t):t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):vm.encode(String(t)),UD=2e4,WD=1e4,ID=6,qD=()=>{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}}},PD=(t,a)=>!a&&(t===xr.Forbidden||t===xr.Unauthorized),FD=(t,a)=>{const o=t.WebSocketImpl??WebSocket,i=t.setTimer??((ee,F)=>setTimeout(ee,F)),l=t.clearTimer??(ee=>clearTimeout(ee)),u=t.backoff??qD(),f=t.heartbeatMs??UD,m=t.heartbeatDeadlineMs??WD,g=t.maxOfflineRetries??ID;let p=null,y=0,v=!1,k=!1,S=!1,T=0,w=null,E=null,C=null;const j=`${t.gatewayUrl}/relay?daemonId=${encodeURIComponent(t.daemonId)}`,_=()=>{C!==null&&(l(C),C=null)},N=()=>{E!==null&&(clearInterval(E),E=null),_()},O=(ee,F)=>{N(),E=setInterval(()=>{if(ee.readyState===ee.OPEN){try{ee.send(jx)}catch{}C===null&&(C=i(()=>{if(C=null,!(F!==y||k)){N();try{ee.close()}catch{}}},m))}},f)},M=()=>{if(k||v||S)return;const ee=++y;let F=!1;const J=new o(j,[`bearer.${t.phoneSessionToken}`]);J.binaryType="arraybuffer",p=J,J.onopen=()=>{ee!==y||k||(F=!0,u.reset(),T=0,O(J,ee),a.onUp())},J.onmessage=X=>{if(ee!==y||k)return;const V=X.data;if(typeof V=="string"){if(V.startsWith(cb)){let P;try{P=JSON.parse(V.slice(cb.length))}catch{return}if(P.t==="revoked"){L(xr.Revoked),a.onControl(P);return}a.onControl(P);return}V===Ax&&_();return}const D=V instanceof ArrayBuffer?new Uint8Array(V):new Uint8Array(V);a.onFrame(D)},J.onerror=()=>{},J.onclose=X=>{if(ee!==y||k)return;N(),p=null;const V=X.code??xr.InternalError;if(G5(V)||PD(V,F)){L(V);return}if(V===xr.DaemonOffline){if(T+=1,T>=g){S=!0,a.onDown({code:V,authFatal:!1,daemonOffline:!0});return}}else T=0;const D=u.next();a.onDown({code:V,authFatal:!1,nextRetryInMs:D}),w=i(()=>{w=null,M()},D)}},L=ee=>{v||(v=!0,N(),w!==null&&(l(w),w=null),a.onDown({code:ee,authFatal:!0}))},U=()=>{k||v||S||p!==null&&(p.readyState===p.OPEN||p.readyState===WebSocket.CONNECTING)||(w!==null&&(l(w),w=null),M())},q=()=>{typeof document<"u"&&document.visibilityState==="visible"&&U()},ae=()=>U();return typeof document<"u"&&document.addEventListener("visibilitychange",q),typeof window<"u"&&window.addEventListener("online",ae),M(),{send(ee){p&&p.readyState===p.OPEN&&p.send(ee)},bufferedAmount:()=>p&&p.readyState===p.OPEN?p.bufferedAmount:0,isOpen:()=>p!==null&&p.readyState===p.OPEN,resume(){k||v||!S||(S=!1,T=0,u.reset(),M())},close(){if(k=!0,y+=1,N(),w!==null&&(l(w),w=null),p){try{p.close()}catch{}p=null}typeof document<"u"&&document.removeEventListener("visibilitychange",q),typeof window<"u"&&window.removeEventListener("online",ae)}}};function KD(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=(N,O)=>{o={state:N,...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,m=!1;const g=new Set,p=t.setTimer??((N,O)=>setTimeout(N,O)),y=t.clearTimer??(N=>clearTimeout(N)),v=()=>{for(const N of g)N.timer!==null&&y(N.timer),N.resolve();g.clear()},k=N=>{for(const O of g)O.timer!==null&&y(O.timer),O.reject(new Error(`tunnel: ${N}`));g.clear()},S=()=>{u=!1},T=()=>{u||(m=!1,f=!1,u=!0,i("online"),v())},w=()=>{m=!0,u=!1,_.beginChannel()},E=4*1024*1024,C=50,j=()=>new Promise(N=>{const O=()=>{if(!l||l.bufferedAmount()<=E){N();return}p(O,C)};O()}),_=HD({roots:a.roots,daemonId:a.daemonId,deviceId:a.deviceId,send:N=>l?.send(N),onReady:T,awaitDrain:j});return l=FD({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:N=>{try{_.onFrame(N)}catch{_.resetAll("frame_open_failed"),l?.close(),i("disconnected",{reason:"integrity"})}},onControl:N=>{if(N.t==="peer-offline"&&N.role==="daemon")f=!0,m=!1,S(),_.resetAll("peer_offline"),i("reconnecting");else if(N.t==="peer-online"&&N.role==="daemon"){if(u||m||!f)return;f=!1,w()}else N.t==="revoked"&&(f=!1,m=!1,S(),_.resetAll("revoked"),k(N.reason??"revoked"),i("revoked",{reason:N.reason}))},onUp:()=>{f=!1,w()},onDown:N=>{f=!1,m=!1,S(),_.resetAll(N.authFatal?"auth_fatal":N.daemonOffline?"daemon_offline":"transient"),N.authFatal?(k("auth_fatal"),i("revoked")):N.daemonOffline?(k("daemon_offline"),i("disconnected",{reason:"daemon_offline",retry:()=>l?.resume()})):i("reconnecting",N.nextRetryInMs!==void 0?{nextRetryInMs:N.nextRetryInMs}:void 0)}}),{requiresUiSession:!1,fetch:(N,O)=>_.fetch(N,O),openWebSocket:(N,O)=>_.openWebSocket(N,O),status:()=>o,ready:(N={})=>{if(u)return Promise.resolve();const O=N.timeoutMs??1e4;return new Promise((M,L)=>{const U={resolve:M,reject:L,timer:null};U.timer=p(()=>{g.delete(U),L(new Error("tunnel: channel ready timed out"))},O),g.add(U)})},dispose:()=>{f=!1,m=!1,S(),l?.close(),l=null,_.resetAll("disposed"),k("disposed")}}}const YD=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(m){return m.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}: ${m.message}`}}}const f=KD({session:u,onStatus:a,...t.WebSocketImpl?{WebSocketImpl:t.WebSocketImpl}:{}});try{await f.ready({timeoutMs:t.readyTimeoutMs??1e4})}catch(m){return f.dispose(),{ok:!1,failure:{code:"select_failed",message:`could not open a ready tunnel for ${o}: ${m.message}`}}}return _T(f),{ok:!0}}},VD=(t={})=>{if(!(t.isGateway??c1)())return{mode:"direct"};if(!t.resolveSession)throw new Error("bootTransport: a gateway bundle requires resolveSession to build the tunnel");return{mode:"tunnel",connectTransport:YD({resolveSession:t.resolveSession,...t.onStatus?{onStatus:t.onStatus}:{},...t.WebSocketImpl?{WebSocketImpl:t.WebSocketImpl}:{},...t.readyTimeoutMs!==void 0?{readyTimeoutMs:t.readyTimeoutMs}:{}})}},$D=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:Js(t.rootKeys.d2p),p2d:Js(t.rootKeys.p2d)},deviceId:t.deviceId,daemonId:t.daemonId,gatewayUrl:o,phoneSessionToken:l}},g1=document.getElementById("root");if(!g1)throw new Error("Root element not found");const GD=VD({resolveSession:$D,onStatus:RR});K2.createRoot(g1).render(c.jsx(b.StrictMode,{children:vD(GD,$5,gD)}));lR();export{mc as $,dc as A,mM as B,No as C,dM as D,ai as E,oM as F,lM as G,Gb as H,Kb as I,ri as J,cM as K,Fa as L,nE as M,fM as N,Oo as O,Ro as P,km as Q,_o as R,xE as S,Qe as T,IS as U,uM as V,Qb as W,Ka as X,sM as Y,iM as Z,Ua as _,hM as a,ei as a0,u_ as a1,nM as a2,aM as a3,VT as a4,rM as a5,Fs as a6,G0 as a7,xm as a8,SM as a9,Yb as aa,Pb as ab,Fl as ac,_S as ad,EM as ae,Vb as af,P_ as ag,xM as ah,Nt as ai,Lw as aj,Zw as ak,kM as al,jA as am,wm as an,eM as ao,tM as ap,gS as aq,fc as b,ye as c,qb as d,en as e,vM as f,QD as g,SE as h,wt as i,c as j,Do as k,pM as l,Mo as m,jS as n,yM as o,bM as p,jo as q,b as r,JD as s,pc as t,we as u,wM as v,gM as w,Ga as x,Cr as y,ZD as z};
|